Skip to content

Commit

Permalink
doc.body.indexOpt=DOCS_ONLY
Browse files Browse the repository at this point in the history
  • Loading branch information
IvanMamontov committed May 5, 2015
1 parent 378be48 commit fddc1ff
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
import org.apache.lucene.document.DoubleField;
import org.apache.lucene.document.StringField;
import org.apache.lucene.document.TextField;
import org.apache.lucene.index.FieldInfo.IndexOptions;

/**
* Creates {@link Document} objects. Uses a {@link ContentSource} to generate
Expand Down Expand Up @@ -433,6 +434,7 @@ public void setConfig(Config config, ContentSource source) {
boolean termVec = config.get("doc.term.vector", false);
boolean termVecPositions = config.get("doc.term.vector.positions", false);
boolean termVecOffsets = config.get("doc.term.vector.offsets", false);
IndexOptions bodyIndexOpts = IndexOptions.valueOf(config.get("doc.body.indexOpt", IndexOptions.DOCS_AND_FREQS_AND_POSITIONS.toString()));

valType = new FieldType(TextField.TYPE_NOT_STORED);
valType.setStored(stored);
Expand All @@ -447,6 +449,7 @@ public void setConfig(Config config, ContentSource source) {
bodyValType.setStored(bodyStored);
bodyValType.setTokenized(bodyTokenized);
bodyValType.setOmitNorms(!bodyNorms);
bodyValType.setIndexOptions(bodyIndexOpts);
bodyValType.setStoreTermVectors(termVec);
bodyValType.setStoreTermVectorPositions(termVecPositions);
bodyValType.setStoreTermVectorOffsets(termVecOffsets);
Expand Down

0 comments on commit fddc1ff

Please sign in to comment.