Skip to content

Commit

Permalink
Use IndexOption.DOCS_ONLY for boolean fields
Browse files Browse the repository at this point in the history
  • Loading branch information
s1monw committed Apr 6, 2013
1 parent 9f6c8c8 commit 7ad03ed
Showing 1 changed file with 2 additions and 45 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

import org.apache.lucene.document.Field;
import org.apache.lucene.document.FieldType;
import org.apache.lucene.index.FieldInfo.IndexOptions;
import org.apache.lucene.search.Filter;
import org.apache.lucene.util.BytesRef;
import org.elasticsearch.common.Booleans;
Expand Down Expand Up @@ -58,6 +59,7 @@ public static class Defaults extends AbstractFieldMapper.Defaults {

static {
FIELD_TYPE.setOmitNorms(true);
FIELD_TYPE.setIndexOptions(IndexOptions.DOCS_ONLY);
FIELD_TYPE.freeze();
}

Expand All @@ -83,51 +85,6 @@ public Builder nullValue(boolean nullValue) {
return this;
}

@Override
public Builder index(boolean index) {
return super.index(index);
}

@Override
public Builder store(boolean store) {
return super.store(store);
}

@Override
protected Builder storeTermVectors(boolean termVectors) {
return super.storeTermVectors(termVectors);
}

@Override
protected Builder storeTermVectorOffsets(boolean termVectorOffsets) {
return super.storeTermVectorOffsets(termVectorOffsets);
}

@Override
protected Builder storeTermVectorPositions(boolean termVectorPositions) {
return super.storeTermVectorPositions(termVectorPositions);
}

@Override
protected Builder storeTermVectorPayloads(boolean termVectorPayloads) {
return super.storeTermVectorPayloads(termVectorPayloads);
}

@Override
public Builder boost(float boost) {
return super.boost(boost);
}

@Override
public Builder indexName(String indexName) {
return super.indexName(indexName);
}

@Override
public Builder similarity(SimilarityProvider similarity) {
return super.similarity(similarity);
}

@Override
public BooleanFieldMapper build(BuilderContext context) {
return new BooleanFieldMapper(buildNames(context), boost, fieldType, nullValue, provider, similarity, fieldDataSettings);
Expand Down

0 comments on commit 7ad03ed

Please sign in to comment.