Explicit doc_values setting.
Once doc values are enabled on a field, they can't be disabled. Close #4560
This commit is contained in:
parent
7694f0b7a0
commit
1654ae8937
|
@ -88,6 +88,9 @@ searchable at all (as an individual field; it may still be included in
|
||||||
`_all`). Setting to `no` disables `include_in_all`. Defaults to
|
`_all`). Setting to `no` disables `include_in_all`. Defaults to
|
||||||
`analyzed`.
|
`analyzed`.
|
||||||
|
|
||||||
|
|`doc_values` |Set to `true` to store field values in a column-stride fashion.
|
||||||
|
Automatically set to `true` when the fielddata format is `doc_values`.
|
||||||
|
|
||||||
|`term_vector` |Possible values are `no`, `yes`, `with_offsets`,
|
|`term_vector` |Possible values are `no`, `yes`, `with_offsets`,
|
||||||
`with_positions`, `with_positions_offsets`. Defaults to `no`.
|
`with_positions`, `with_positions_offsets`. Defaults to `no`.
|
||||||
|
|
||||||
|
@ -195,6 +198,9 @@ and it can be retrieved from it).
|
||||||
in `_source`, have `include_in_all` enabled, or `store` should be set to
|
in `_source`, have `include_in_all` enabled, or `store` should be set to
|
||||||
`true` for this to be useful.
|
`true` for this to be useful.
|
||||||
|
|
||||||
|
|`doc_values` |Set to `true` to store field values in a column-stride fashion.
|
||||||
|
Automatically set to `true` when the fielddata format is `doc_values`.
|
||||||
|
|
||||||
|`precision_step` |The precision step (number of terms generated for
|
|`precision_step` |The precision step (number of terms generated for
|
||||||
each number value). Defaults to `4`.
|
each number value). Defaults to `4`.
|
||||||
|
|
||||||
|
@ -303,6 +309,9 @@ and it can be retrieved from it).
|
||||||
in `_source`, have `include_in_all` enabled, or `store` should be set to
|
in `_source`, have `include_in_all` enabled, or `store` should be set to
|
||||||
`true` for this to be useful.
|
`true` for this to be useful.
|
||||||
|
|
||||||
|
|`doc_values` |Set to `true` to store field values in a column-stride fashion.
|
||||||
|
Automatically set to `true` when the fielddata format is `doc_values`.
|
||||||
|
|
||||||
|`precision_step` |The precision step (number of terms generated for
|
|`precision_step` |The precision step (number of terms generated for
|
||||||
each number value). Defaults to `4`.
|
each number value). Defaults to `4`.
|
||||||
|
|
||||||
|
|
|
@ -64,6 +64,7 @@ public abstract class AbstractFieldMapper<T> implements FieldMapper<T> {
|
||||||
|
|
||||||
public static class Defaults {
|
public static class Defaults {
|
||||||
public static final FieldType FIELD_TYPE = new FieldType();
|
public static final FieldType FIELD_TYPE = new FieldType();
|
||||||
|
public static final boolean DOC_VALUES = false;
|
||||||
|
|
||||||
static {
|
static {
|
||||||
FIELD_TYPE.setIndexed(true);
|
FIELD_TYPE.setIndexed(true);
|
||||||
|
@ -81,6 +82,7 @@ public abstract class AbstractFieldMapper<T> implements FieldMapper<T> {
|
||||||
public abstract static class Builder<T extends Builder, Y extends AbstractFieldMapper> extends Mapper.Builder<T, Y> {
|
public abstract static class Builder<T extends Builder, Y extends AbstractFieldMapper> extends Mapper.Builder<T, Y> {
|
||||||
|
|
||||||
protected final FieldType fieldType;
|
protected final FieldType fieldType;
|
||||||
|
protected Boolean docValues;
|
||||||
protected float boost = Defaults.BOOST;
|
protected float boost = Defaults.BOOST;
|
||||||
protected boolean omitNormsSet = false;
|
protected boolean omitNormsSet = false;
|
||||||
protected String indexName;
|
protected String indexName;
|
||||||
|
@ -109,6 +111,11 @@ public abstract class AbstractFieldMapper<T> implements FieldMapper<T> {
|
||||||
return builder;
|
return builder;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public T docValues(boolean docValues) {
|
||||||
|
this.docValues = docValues;
|
||||||
|
return builder;
|
||||||
|
}
|
||||||
|
|
||||||
public T storeTermVectors(boolean termVectors) {
|
public T storeTermVectors(boolean termVectors) {
|
||||||
this.fieldType.setStoreTermVectors(termVectors);
|
this.fieldType.setStoreTermVectors(termVectors);
|
||||||
return builder;
|
return builder;
|
||||||
|
@ -227,7 +234,7 @@ public abstract class AbstractFieldMapper<T> implements FieldMapper<T> {
|
||||||
protected Settings customFieldDataSettings;
|
protected Settings customFieldDataSettings;
|
||||||
protected FieldDataType fieldDataType;
|
protected FieldDataType fieldDataType;
|
||||||
|
|
||||||
protected AbstractFieldMapper(Names names, float boost, FieldType fieldType, NamedAnalyzer indexAnalyzer,
|
protected AbstractFieldMapper(Names names, float boost, FieldType fieldType, Boolean docValues, NamedAnalyzer indexAnalyzer,
|
||||||
NamedAnalyzer searchAnalyzer, PostingsFormatProvider postingsFormat,
|
NamedAnalyzer searchAnalyzer, PostingsFormatProvider postingsFormat,
|
||||||
DocValuesFormatProvider docValuesFormat, SimilarityProvider similarity,
|
DocValuesFormatProvider docValuesFormat, SimilarityProvider similarity,
|
||||||
@Nullable Settings fieldDataSettings, Settings indexSettings) {
|
@Nullable Settings fieldDataSettings, Settings indexSettings) {
|
||||||
|
@ -266,8 +273,10 @@ public abstract class AbstractFieldMapper<T> implements FieldMapper<T> {
|
||||||
ImmutableSettings.builder().put(defaultFieldDataType().getSettings()).put(fieldDataSettings)
|
ImmutableSettings.builder().put(defaultFieldDataType().getSettings()).put(fieldDataSettings)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if (fieldDataType == null) {
|
if (docValues != null) {
|
||||||
docValues = false;
|
this.docValues = docValues;
|
||||||
|
} else if (fieldDataType == null) {
|
||||||
|
this.docValues = false;
|
||||||
} else {
|
} else {
|
||||||
this.docValues = FieldDataType.DOC_VALUES_FORMAT_VALUE.equals(fieldDataType.getFormat(indexSettings));
|
this.docValues = FieldDataType.DOC_VALUES_FORMAT_VALUE.equals(fieldDataType.getFormat(indexSettings));
|
||||||
}
|
}
|
||||||
|
@ -498,6 +507,11 @@ public abstract class AbstractFieldMapper<T> implements FieldMapper<T> {
|
||||||
if (this.fieldType().stored() != fieldMergeWith.fieldType().stored()) {
|
if (this.fieldType().stored() != fieldMergeWith.fieldType().stored()) {
|
||||||
mergeContext.addConflict("mapper [" + names.fullName() + "] has different store values");
|
mergeContext.addConflict("mapper [" + names.fullName() + "] has different store values");
|
||||||
}
|
}
|
||||||
|
if (!this.hasDocValues() && fieldMergeWith.hasDocValues()) {
|
||||||
|
// don't add conflict if this mapper has doc values while the mapper to merge doesn't since doc values are implicitely set
|
||||||
|
// when the doc_values field data format is configured
|
||||||
|
mergeContext.addConflict("mapper [" + names.fullName() + "] has different " + TypeParsers.DOC_VALUES + " values");
|
||||||
|
}
|
||||||
if (this.fieldType().tokenized() != fieldMergeWith.fieldType().tokenized()) {
|
if (this.fieldType().tokenized() != fieldMergeWith.fieldType().tokenized()) {
|
||||||
mergeContext.addConflict("mapper [" + names.fullName() + "] has different tokenize values");
|
mergeContext.addConflict("mapper [" + names.fullName() + "] has different tokenize values");
|
||||||
}
|
}
|
||||||
|
@ -593,6 +607,9 @@ public abstract class AbstractFieldMapper<T> implements FieldMapper<T> {
|
||||||
if (includeDefaults || fieldType.stored() != defaultFieldType.stored()) {
|
if (includeDefaults || fieldType.stored() != defaultFieldType.stored()) {
|
||||||
builder.field("store", fieldType.stored());
|
builder.field("store", fieldType.stored());
|
||||||
}
|
}
|
||||||
|
if (includeDefaults || hasDocValues() != Defaults.DOC_VALUES) {
|
||||||
|
builder.field(TypeParsers.DOC_VALUES, docValues);
|
||||||
|
}
|
||||||
if (includeDefaults || fieldType.storeTermVectors() != defaultFieldType.storeTermVectors()) {
|
if (includeDefaults || fieldType.storeTermVectors() != defaultFieldType.storeTermVectors()) {
|
||||||
builder.field("term_vector", termVectorOptionsToString(fieldType));
|
builder.field("term_vector", termVectorOptionsToString(fieldType));
|
||||||
}
|
}
|
||||||
|
|
|
@ -121,7 +121,7 @@ public class BinaryFieldMapper extends AbstractFieldMapper<BytesReference> {
|
||||||
|
|
||||||
protected BinaryFieldMapper(Names names, FieldType fieldType, Boolean compress, long compressThreshold,
|
protected BinaryFieldMapper(Names names, FieldType fieldType, Boolean compress, long compressThreshold,
|
||||||
PostingsFormatProvider postingsProvider, DocValuesFormatProvider docValuesProvider) {
|
PostingsFormatProvider postingsProvider, DocValuesFormatProvider docValuesProvider) {
|
||||||
super(names, 1.0f, fieldType, null, null, postingsProvider, docValuesProvider, null, null, null);
|
super(names, 1.0f, fieldType, null, null, null, postingsProvider, docValuesProvider, null, null, null);
|
||||||
this.compress = compress;
|
this.compress = compress;
|
||||||
this.compressThreshold = compressThreshold;
|
this.compressThreshold = compressThreshold;
|
||||||
}
|
}
|
||||||
|
|
|
@ -124,7 +124,7 @@ public class BooleanFieldMapper extends AbstractFieldMapper<Boolean> {
|
||||||
protected BooleanFieldMapper(Names names, float boost, FieldType fieldType, Boolean nullValue, PostingsFormatProvider postingsProvider,
|
protected BooleanFieldMapper(Names names, float boost, FieldType fieldType, Boolean nullValue, PostingsFormatProvider postingsProvider,
|
||||||
DocValuesFormatProvider docValuesProvider, SimilarityProvider similarity, @Nullable Settings fieldDataSettings,
|
DocValuesFormatProvider docValuesProvider, SimilarityProvider similarity, @Nullable Settings fieldDataSettings,
|
||||||
Settings indexSettings) {
|
Settings indexSettings) {
|
||||||
super(names, boost, fieldType, Lucene.KEYWORD_ANALYZER, Lucene.KEYWORD_ANALYZER, postingsProvider, docValuesProvider, similarity, fieldDataSettings, indexSettings);
|
super(names, boost, fieldType, null, Lucene.KEYWORD_ANALYZER, Lucene.KEYWORD_ANALYZER, postingsProvider, docValuesProvider, similarity, fieldDataSettings, indexSettings);
|
||||||
this.nullValue = nullValue;
|
this.nullValue = nullValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -91,7 +91,7 @@ public class ByteFieldMapper extends NumberFieldMapper<Byte> {
|
||||||
public ByteFieldMapper build(BuilderContext context) {
|
public ByteFieldMapper build(BuilderContext context) {
|
||||||
fieldType.setOmitNorms(fieldType.omitNorms() && boost == 1.0f);
|
fieldType.setOmitNorms(fieldType.omitNorms() && boost == 1.0f);
|
||||||
ByteFieldMapper fieldMapper = new ByteFieldMapper(buildNames(context),
|
ByteFieldMapper fieldMapper = new ByteFieldMapper(buildNames(context),
|
||||||
precisionStep, boost, fieldType, nullValue, ignoreMalformed(context),
|
precisionStep, boost, fieldType, docValues, nullValue, ignoreMalformed(context),
|
||||||
postingsProvider, docValuesProvider, similarity, fieldDataSettings, context.indexSettings());
|
postingsProvider, docValuesProvider, similarity, fieldDataSettings, context.indexSettings());
|
||||||
fieldMapper.includeInAll(includeInAll);
|
fieldMapper.includeInAll(includeInAll);
|
||||||
return fieldMapper;
|
return fieldMapper;
|
||||||
|
@ -118,11 +118,11 @@ public class ByteFieldMapper extends NumberFieldMapper<Byte> {
|
||||||
|
|
||||||
private String nullValueAsString;
|
private String nullValueAsString;
|
||||||
|
|
||||||
protected ByteFieldMapper(Names names, int precisionStep, float boost, FieldType fieldType,
|
protected ByteFieldMapper(Names names, int precisionStep, float boost, FieldType fieldType, Boolean docValues,
|
||||||
Byte nullValue, Explicit<Boolean> ignoreMalformed, PostingsFormatProvider postingsProvider,
|
Byte nullValue, Explicit<Boolean> ignoreMalformed, PostingsFormatProvider postingsProvider,
|
||||||
DocValuesFormatProvider docValuesProvider, SimilarityProvider similarity,
|
DocValuesFormatProvider docValuesProvider, SimilarityProvider similarity,
|
||||||
@Nullable Settings fieldDataSettings, Settings indexSettings) {
|
@Nullable Settings fieldDataSettings, Settings indexSettings) {
|
||||||
super(names, precisionStep, boost, fieldType,
|
super(names, precisionStep, boost, fieldType, docValues,
|
||||||
ignoreMalformed, new NamedAnalyzer("_byte/" + precisionStep, new NumericIntegerAnalyzer(precisionStep)),
|
ignoreMalformed, new NamedAnalyzer("_byte/" + precisionStep, new NumericIntegerAnalyzer(precisionStep)),
|
||||||
new NamedAnalyzer("_byte/max", new NumericIntegerAnalyzer(Integer.MAX_VALUE)), postingsProvider,
|
new NamedAnalyzer("_byte/max", new NumericIntegerAnalyzer(Integer.MAX_VALUE)), postingsProvider,
|
||||||
docValuesProvider, similarity, fieldDataSettings, indexSettings);
|
docValuesProvider, similarity, fieldDataSettings, indexSettings);
|
||||||
|
|
|
@ -195,7 +195,7 @@ public class CompletionFieldMapper extends AbstractFieldMapper<String> {
|
||||||
|
|
||||||
public CompletionFieldMapper(Names names, NamedAnalyzer indexAnalyzer, NamedAnalyzer searchAnalyzer, PostingsFormatProvider postingsProvider, SimilarityProvider similarity, boolean payloads,
|
public CompletionFieldMapper(Names names, NamedAnalyzer indexAnalyzer, NamedAnalyzer searchAnalyzer, PostingsFormatProvider postingsProvider, SimilarityProvider similarity, boolean payloads,
|
||||||
boolean preserveSeparators, boolean preservePositionIncrements, int maxInputLength) {
|
boolean preserveSeparators, boolean preservePositionIncrements, int maxInputLength) {
|
||||||
super(names, 1.0f, Defaults.FIELD_TYPE, indexAnalyzer, searchAnalyzer, postingsProvider, null, similarity, null, null);
|
super(names, 1.0f, Defaults.FIELD_TYPE, null, indexAnalyzer, searchAnalyzer, postingsProvider, null, similarity, null, null);
|
||||||
analyzingSuggestLookupProvider = new AnalyzingCompletionLookupProvider(preserveSeparators, false, preservePositionIncrements, payloads);
|
analyzingSuggestLookupProvider = new AnalyzingCompletionLookupProvider(preserveSeparators, false, preservePositionIncrements, payloads);
|
||||||
this.completionPostingsFormatProvider = new CompletionPostingsFormatProvider("completion", postingsProvider, analyzingSuggestLookupProvider);
|
this.completionPostingsFormatProvider = new CompletionPostingsFormatProvider("completion", postingsProvider, analyzingSuggestLookupProvider);
|
||||||
this.preserveSeparators = preserveSeparators;
|
this.preserveSeparators = preserveSeparators;
|
||||||
|
|
|
@ -128,7 +128,7 @@ public class DateFieldMapper extends NumberFieldMapper<Long> {
|
||||||
dateTimeFormatter = new FormatDateTimeFormatter(dateTimeFormatter.format(), dateTimeFormatter.parser(), dateTimeFormatter.printer(), locale);
|
dateTimeFormatter = new FormatDateTimeFormatter(dateTimeFormatter.format(), dateTimeFormatter.parser(), dateTimeFormatter.printer(), locale);
|
||||||
}
|
}
|
||||||
DateFieldMapper fieldMapper = new DateFieldMapper(buildNames(context), dateTimeFormatter,
|
DateFieldMapper fieldMapper = new DateFieldMapper(buildNames(context), dateTimeFormatter,
|
||||||
precisionStep, boost, fieldType, nullValue, timeUnit, roundCeil, ignoreMalformed(context),
|
precisionStep, boost, fieldType, docValues, nullValue, timeUnit, roundCeil, ignoreMalformed(context),
|
||||||
postingsProvider, docValuesProvider, similarity, fieldDataSettings, context.indexSettings());
|
postingsProvider, docValuesProvider, similarity, fieldDataSettings, context.indexSettings());
|
||||||
fieldMapper.includeInAll(includeInAll);
|
fieldMapper.includeInAll(includeInAll);
|
||||||
return fieldMapper;
|
return fieldMapper;
|
||||||
|
@ -200,11 +200,11 @@ public class DateFieldMapper extends NumberFieldMapper<Long> {
|
||||||
|
|
||||||
protected final TimeUnit timeUnit;
|
protected final TimeUnit timeUnit;
|
||||||
|
|
||||||
protected DateFieldMapper(Names names, FormatDateTimeFormatter dateTimeFormatter, int precisionStep, float boost, FieldType fieldType,
|
protected DateFieldMapper(Names names, FormatDateTimeFormatter dateTimeFormatter, int precisionStep, float boost, FieldType fieldType, Boolean docValues,
|
||||||
String nullValue, TimeUnit timeUnit, boolean roundCeil, Explicit<Boolean> ignoreMalformed,
|
String nullValue, TimeUnit timeUnit, boolean roundCeil, Explicit<Boolean> ignoreMalformed,
|
||||||
PostingsFormatProvider postingsProvider, DocValuesFormatProvider docValuesProvider, SimilarityProvider similarity,
|
PostingsFormatProvider postingsProvider, DocValuesFormatProvider docValuesProvider, SimilarityProvider similarity,
|
||||||
@Nullable Settings fieldDataSettings, Settings indexSettings) {
|
@Nullable Settings fieldDataSettings, Settings indexSettings) {
|
||||||
super(names, precisionStep, boost, fieldType, ignoreMalformed, new NamedAnalyzer("_date/" + precisionStep,
|
super(names, precisionStep, boost, fieldType, docValues, ignoreMalformed, new NamedAnalyzer("_date/" + precisionStep,
|
||||||
new NumericDateAnalyzer(precisionStep, dateTimeFormatter.parser())),
|
new NumericDateAnalyzer(precisionStep, dateTimeFormatter.parser())),
|
||||||
new NamedAnalyzer("_date/max", new NumericDateAnalyzer(Integer.MAX_VALUE, dateTimeFormatter.parser())),
|
new NamedAnalyzer("_date/max", new NumericDateAnalyzer(Integer.MAX_VALUE, dateTimeFormatter.parser())),
|
||||||
postingsProvider, docValuesProvider, similarity, fieldDataSettings, indexSettings);
|
postingsProvider, docValuesProvider, similarity, fieldDataSettings, indexSettings);
|
||||||
|
|
|
@ -94,7 +94,7 @@ public class DoubleFieldMapper extends NumberFieldMapper<Double> {
|
||||||
public DoubleFieldMapper build(BuilderContext context) {
|
public DoubleFieldMapper build(BuilderContext context) {
|
||||||
fieldType.setOmitNorms(fieldType.omitNorms() && boost == 1.0f);
|
fieldType.setOmitNorms(fieldType.omitNorms() && boost == 1.0f);
|
||||||
DoubleFieldMapper fieldMapper = new DoubleFieldMapper(buildNames(context),
|
DoubleFieldMapper fieldMapper = new DoubleFieldMapper(buildNames(context),
|
||||||
precisionStep, boost, fieldType, nullValue, ignoreMalformed(context), postingsProvider, docValuesProvider,
|
precisionStep, boost, fieldType, docValues, nullValue, ignoreMalformed(context), postingsProvider, docValuesProvider,
|
||||||
similarity, fieldDataSettings, context.indexSettings());
|
similarity, fieldDataSettings, context.indexSettings());
|
||||||
fieldMapper.includeInAll(includeInAll);
|
fieldMapper.includeInAll(includeInAll);
|
||||||
return fieldMapper;
|
return fieldMapper;
|
||||||
|
@ -122,11 +122,11 @@ public class DoubleFieldMapper extends NumberFieldMapper<Double> {
|
||||||
|
|
||||||
private String nullValueAsString;
|
private String nullValueAsString;
|
||||||
|
|
||||||
protected DoubleFieldMapper(Names names, int precisionStep, float boost, FieldType fieldType,
|
protected DoubleFieldMapper(Names names, int precisionStep, float boost, FieldType fieldType, Boolean docValues,
|
||||||
Double nullValue, Explicit<Boolean> ignoreMalformed,
|
Double nullValue, Explicit<Boolean> ignoreMalformed,
|
||||||
PostingsFormatProvider postingsProvider, DocValuesFormatProvider docValuesProvider,
|
PostingsFormatProvider postingsProvider, DocValuesFormatProvider docValuesProvider,
|
||||||
SimilarityProvider similarity, @Nullable Settings fieldDataSettings, Settings indexSettings) {
|
SimilarityProvider similarity, @Nullable Settings fieldDataSettings, Settings indexSettings) {
|
||||||
super(names, precisionStep, boost, fieldType, ignoreMalformed,
|
super(names, precisionStep, boost, fieldType, docValues, ignoreMalformed,
|
||||||
NumericDoubleAnalyzer.buildNamedAnalyzer(precisionStep), NumericDoubleAnalyzer.buildNamedAnalyzer(Integer.MAX_VALUE),
|
NumericDoubleAnalyzer.buildNamedAnalyzer(precisionStep), NumericDoubleAnalyzer.buildNamedAnalyzer(Integer.MAX_VALUE),
|
||||||
postingsProvider, docValuesProvider, similarity, fieldDataSettings, indexSettings);
|
postingsProvider, docValuesProvider, similarity, fieldDataSettings, indexSettings);
|
||||||
this.nullValue = nullValue;
|
this.nullValue = nullValue;
|
||||||
|
|
|
@ -95,7 +95,7 @@ public class FloatFieldMapper extends NumberFieldMapper<Float> {
|
||||||
public FloatFieldMapper build(BuilderContext context) {
|
public FloatFieldMapper build(BuilderContext context) {
|
||||||
fieldType.setOmitNorms(fieldType.omitNorms() && boost == 1.0f);
|
fieldType.setOmitNorms(fieldType.omitNorms() && boost == 1.0f);
|
||||||
FloatFieldMapper fieldMapper = new FloatFieldMapper(buildNames(context),
|
FloatFieldMapper fieldMapper = new FloatFieldMapper(buildNames(context),
|
||||||
precisionStep, boost, fieldType, nullValue, ignoreMalformed(context), postingsProvider, docValuesProvider,
|
precisionStep, boost, fieldType, docValues, nullValue, ignoreMalformed(context), postingsProvider, docValuesProvider,
|
||||||
similarity, fieldDataSettings, context.indexSettings());
|
similarity, fieldDataSettings, context.indexSettings());
|
||||||
fieldMapper.includeInAll(includeInAll);
|
fieldMapper.includeInAll(includeInAll);
|
||||||
return fieldMapper;
|
return fieldMapper;
|
||||||
|
@ -122,11 +122,11 @@ public class FloatFieldMapper extends NumberFieldMapper<Float> {
|
||||||
|
|
||||||
private String nullValueAsString;
|
private String nullValueAsString;
|
||||||
|
|
||||||
protected FloatFieldMapper(Names names, int precisionStep, float boost, FieldType fieldType,
|
protected FloatFieldMapper(Names names, int precisionStep, float boost, FieldType fieldType, Boolean docValues,
|
||||||
Float nullValue, Explicit<Boolean> ignoreMalformed,
|
Float nullValue, Explicit<Boolean> ignoreMalformed,
|
||||||
PostingsFormatProvider postingsProvider, DocValuesFormatProvider docValuesProvider,
|
PostingsFormatProvider postingsProvider, DocValuesFormatProvider docValuesProvider,
|
||||||
SimilarityProvider similarity, @Nullable Settings fieldDataSettings, Settings indexSettings) {
|
SimilarityProvider similarity, @Nullable Settings fieldDataSettings, Settings indexSettings) {
|
||||||
super(names, precisionStep, boost, fieldType, ignoreMalformed,
|
super(names, precisionStep, boost, fieldType, docValues, ignoreMalformed,
|
||||||
NumericFloatAnalyzer.buildNamedAnalyzer(precisionStep), NumericFloatAnalyzer.buildNamedAnalyzer(Integer.MAX_VALUE),
|
NumericFloatAnalyzer.buildNamedAnalyzer(precisionStep), NumericFloatAnalyzer.buildNamedAnalyzer(Integer.MAX_VALUE),
|
||||||
postingsProvider, docValuesProvider, similarity, fieldDataSettings, indexSettings);
|
postingsProvider, docValuesProvider, similarity, fieldDataSettings, indexSettings);
|
||||||
this.nullValue = nullValue;
|
this.nullValue = nullValue;
|
||||||
|
|
|
@ -90,7 +90,7 @@ public class IntegerFieldMapper extends NumberFieldMapper<Integer> {
|
||||||
@Override
|
@Override
|
||||||
public IntegerFieldMapper build(BuilderContext context) {
|
public IntegerFieldMapper build(BuilderContext context) {
|
||||||
fieldType.setOmitNorms(fieldType.omitNorms() && boost == 1.0f);
|
fieldType.setOmitNorms(fieldType.omitNorms() && boost == 1.0f);
|
||||||
IntegerFieldMapper fieldMapper = new IntegerFieldMapper(buildNames(context), precisionStep, boost, fieldType,
|
IntegerFieldMapper fieldMapper = new IntegerFieldMapper(buildNames(context), precisionStep, boost, fieldType, docValues,
|
||||||
nullValue, ignoreMalformed(context), postingsProvider, docValuesProvider, similarity, fieldDataSettings, context.indexSettings());
|
nullValue, ignoreMalformed(context), postingsProvider, docValuesProvider, similarity, fieldDataSettings, context.indexSettings());
|
||||||
fieldMapper.includeInAll(includeInAll);
|
fieldMapper.includeInAll(includeInAll);
|
||||||
return fieldMapper;
|
return fieldMapper;
|
||||||
|
@ -117,11 +117,11 @@ public class IntegerFieldMapper extends NumberFieldMapper<Integer> {
|
||||||
|
|
||||||
private String nullValueAsString;
|
private String nullValueAsString;
|
||||||
|
|
||||||
protected IntegerFieldMapper(Names names, int precisionStep, float boost, FieldType fieldType,
|
protected IntegerFieldMapper(Names names, int precisionStep, float boost, FieldType fieldType, Boolean docValues,
|
||||||
Integer nullValue, Explicit<Boolean> ignoreMalformed,
|
Integer nullValue, Explicit<Boolean> ignoreMalformed,
|
||||||
PostingsFormatProvider postingsProvider, DocValuesFormatProvider docValuesProvider,
|
PostingsFormatProvider postingsProvider, DocValuesFormatProvider docValuesProvider,
|
||||||
SimilarityProvider similarity, @Nullable Settings fieldDataSettings, Settings indexSettings) {
|
SimilarityProvider similarity, @Nullable Settings fieldDataSettings, Settings indexSettings) {
|
||||||
super(names, precisionStep, boost, fieldType, ignoreMalformed,
|
super(names, precisionStep, boost, fieldType, docValues, ignoreMalformed,
|
||||||
NumericIntegerAnalyzer.buildNamedAnalyzer(precisionStep), NumericIntegerAnalyzer.buildNamedAnalyzer(Integer.MAX_VALUE),
|
NumericIntegerAnalyzer.buildNamedAnalyzer(precisionStep), NumericIntegerAnalyzer.buildNamedAnalyzer(Integer.MAX_VALUE),
|
||||||
postingsProvider, docValuesProvider, similarity, fieldDataSettings, indexSettings);
|
postingsProvider, docValuesProvider, similarity, fieldDataSettings, indexSettings);
|
||||||
this.nullValue = nullValue;
|
this.nullValue = nullValue;
|
||||||
|
|
|
@ -90,7 +90,7 @@ public class LongFieldMapper extends NumberFieldMapper<Long> {
|
||||||
@Override
|
@Override
|
||||||
public LongFieldMapper build(BuilderContext context) {
|
public LongFieldMapper build(BuilderContext context) {
|
||||||
fieldType.setOmitNorms(fieldType.omitNorms() && boost == 1.0f);
|
fieldType.setOmitNorms(fieldType.omitNorms() && boost == 1.0f);
|
||||||
LongFieldMapper fieldMapper = new LongFieldMapper(buildNames(context), precisionStep, boost, fieldType, nullValue,
|
LongFieldMapper fieldMapper = new LongFieldMapper(buildNames(context), precisionStep, boost, fieldType, docValues, nullValue,
|
||||||
ignoreMalformed(context), postingsProvider, docValuesProvider, similarity, fieldDataSettings, context.indexSettings());
|
ignoreMalformed(context), postingsProvider, docValuesProvider, similarity, fieldDataSettings, context.indexSettings());
|
||||||
fieldMapper.includeInAll(includeInAll);
|
fieldMapper.includeInAll(includeInAll);
|
||||||
return fieldMapper;
|
return fieldMapper;
|
||||||
|
@ -117,11 +117,11 @@ public class LongFieldMapper extends NumberFieldMapper<Long> {
|
||||||
|
|
||||||
private String nullValueAsString;
|
private String nullValueAsString;
|
||||||
|
|
||||||
protected LongFieldMapper(Names names, int precisionStep, float boost, FieldType fieldType,
|
protected LongFieldMapper(Names names, int precisionStep, float boost, FieldType fieldType, Boolean docValues,
|
||||||
Long nullValue, Explicit<Boolean> ignoreMalformed,
|
Long nullValue, Explicit<Boolean> ignoreMalformed,
|
||||||
PostingsFormatProvider postingsProvider, DocValuesFormatProvider docValuesProvider,
|
PostingsFormatProvider postingsProvider, DocValuesFormatProvider docValuesProvider,
|
||||||
SimilarityProvider similarity, @Nullable Settings fieldDataSettings, Settings indexSettings) {
|
SimilarityProvider similarity, @Nullable Settings fieldDataSettings, Settings indexSettings) {
|
||||||
super(names, precisionStep, boost, fieldType, ignoreMalformed,
|
super(names, precisionStep, boost, fieldType, docValues, ignoreMalformed,
|
||||||
NumericLongAnalyzer.buildNamedAnalyzer(precisionStep), NumericLongAnalyzer.buildNamedAnalyzer(Integer.MAX_VALUE),
|
NumericLongAnalyzer.buildNamedAnalyzer(precisionStep), NumericLongAnalyzer.buildNamedAnalyzer(Integer.MAX_VALUE),
|
||||||
postingsProvider, docValuesProvider, similarity, fieldDataSettings, indexSettings);
|
postingsProvider, docValuesProvider, similarity, fieldDataSettings, indexSettings);
|
||||||
this.nullValue = nullValue;
|
this.nullValue = nullValue;
|
||||||
|
|
|
@ -143,13 +143,13 @@ public abstract class NumberFieldMapper<T extends Number> extends AbstractFieldM
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
protected NumberFieldMapper(Names names, int precisionStep, float boost, FieldType fieldType,
|
protected NumberFieldMapper(Names names, int precisionStep, float boost, FieldType fieldType, Boolean docValues,
|
||||||
Explicit<Boolean> ignoreMalformed, NamedAnalyzer indexAnalyzer,
|
Explicit<Boolean> ignoreMalformed, NamedAnalyzer indexAnalyzer,
|
||||||
NamedAnalyzer searchAnalyzer, PostingsFormatProvider postingsProvider,
|
NamedAnalyzer searchAnalyzer, PostingsFormatProvider postingsProvider,
|
||||||
DocValuesFormatProvider docValuesProvider, SimilarityProvider similarity,
|
DocValuesFormatProvider docValuesProvider, SimilarityProvider similarity,
|
||||||
@Nullable Settings fieldDataSettings, Settings indexSettings) {
|
@Nullable Settings fieldDataSettings, Settings indexSettings) {
|
||||||
// LUCENE 4 UPGRADE: Since we can't do anything before the super call, we have to push the boost check down to subclasses
|
// LUCENE 4 UPGRADE: Since we can't do anything before the super call, we have to push the boost check down to subclasses
|
||||||
super(names, boost, fieldType, indexAnalyzer, searchAnalyzer, postingsProvider, docValuesProvider, similarity, fieldDataSettings, indexSettings);
|
super(names, boost, fieldType, docValues, indexAnalyzer, searchAnalyzer, postingsProvider, docValuesProvider, similarity, fieldDataSettings, indexSettings);
|
||||||
if (precisionStep <= 0 || precisionStep >= maxPrecisionStep()) {
|
if (precisionStep <= 0 || precisionStep >= maxPrecisionStep()) {
|
||||||
this.precisionStep = Integer.MAX_VALUE;
|
this.precisionStep = Integer.MAX_VALUE;
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -91,7 +91,7 @@ public class ShortFieldMapper extends NumberFieldMapper<Short> {
|
||||||
@Override
|
@Override
|
||||||
public ShortFieldMapper build(BuilderContext context) {
|
public ShortFieldMapper build(BuilderContext context) {
|
||||||
fieldType.setOmitNorms(fieldType.omitNorms() && boost == 1.0f);
|
fieldType.setOmitNorms(fieldType.omitNorms() && boost == 1.0f);
|
||||||
ShortFieldMapper fieldMapper = new ShortFieldMapper(buildNames(context), precisionStep, boost, fieldType, nullValue,
|
ShortFieldMapper fieldMapper = new ShortFieldMapper(buildNames(context), precisionStep, boost, fieldType, docValues, nullValue,
|
||||||
ignoreMalformed(context), postingsProvider, docValuesProvider, similarity, fieldDataSettings, context.indexSettings());
|
ignoreMalformed(context), postingsProvider, docValuesProvider, similarity, fieldDataSettings, context.indexSettings());
|
||||||
fieldMapper.includeInAll(includeInAll);
|
fieldMapper.includeInAll(includeInAll);
|
||||||
return fieldMapper;
|
return fieldMapper;
|
||||||
|
@ -118,11 +118,11 @@ public class ShortFieldMapper extends NumberFieldMapper<Short> {
|
||||||
|
|
||||||
private String nullValueAsString;
|
private String nullValueAsString;
|
||||||
|
|
||||||
protected ShortFieldMapper(Names names, int precisionStep, float boost, FieldType fieldType,
|
protected ShortFieldMapper(Names names, int precisionStep, float boost, FieldType fieldType, Boolean docValues,
|
||||||
Short nullValue, Explicit<Boolean> ignoreMalformed,
|
Short nullValue, Explicit<Boolean> ignoreMalformed,
|
||||||
PostingsFormatProvider postingsProvider, DocValuesFormatProvider docValuesProvider,
|
PostingsFormatProvider postingsProvider, DocValuesFormatProvider docValuesProvider,
|
||||||
SimilarityProvider similarity, @Nullable Settings fieldDataSettings, Settings indexSettings) {
|
SimilarityProvider similarity, @Nullable Settings fieldDataSettings, Settings indexSettings) {
|
||||||
super(names, precisionStep, boost, fieldType, ignoreMalformed, new NamedAnalyzer("_short/" + precisionStep,
|
super(names, precisionStep, boost, fieldType, docValues, ignoreMalformed, new NamedAnalyzer("_short/" + precisionStep,
|
||||||
new NumericIntegerAnalyzer(precisionStep)), new NamedAnalyzer("_short/max", new NumericIntegerAnalyzer(Integer.MAX_VALUE)),
|
new NumericIntegerAnalyzer(precisionStep)), new NamedAnalyzer("_short/max", new NumericIntegerAnalyzer(Integer.MAX_VALUE)),
|
||||||
postingsProvider, docValuesProvider, similarity, fieldDataSettings, indexSettings);
|
postingsProvider, docValuesProvider, similarity, fieldDataSettings, indexSettings);
|
||||||
this.nullValue = nullValue;
|
this.nullValue = nullValue;
|
||||||
|
|
|
@ -134,7 +134,7 @@ public class StringFieldMapper extends AbstractFieldMapper<String> implements Al
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
StringFieldMapper fieldMapper = new StringFieldMapper(buildNames(context),
|
StringFieldMapper fieldMapper = new StringFieldMapper(buildNames(context),
|
||||||
boost, fieldType, nullValue, indexAnalyzer, searchAnalyzer, searchQuotedAnalyzer,
|
boost, fieldType, docValues, nullValue, indexAnalyzer, searchAnalyzer, searchQuotedAnalyzer,
|
||||||
positionOffsetGap, ignoreAbove, postingsProvider, docValuesProvider, similarity, fieldDataSettings, context.indexSettings());
|
positionOffsetGap, ignoreAbove, postingsProvider, docValuesProvider, similarity, fieldDataSettings, context.indexSettings());
|
||||||
fieldMapper.includeInAll(includeInAll);
|
fieldMapper.includeInAll(includeInAll);
|
||||||
return fieldMapper;
|
return fieldMapper;
|
||||||
|
@ -188,12 +188,12 @@ public class StringFieldMapper extends AbstractFieldMapper<String> implements Al
|
||||||
|
|
||||||
private int ignoreAbove;
|
private int ignoreAbove;
|
||||||
|
|
||||||
protected StringFieldMapper(Names names, float boost, FieldType fieldType,
|
protected StringFieldMapper(Names names, float boost, FieldType fieldType, Boolean docValues,
|
||||||
String nullValue, NamedAnalyzer indexAnalyzer, NamedAnalyzer searchAnalyzer,
|
String nullValue, NamedAnalyzer indexAnalyzer, NamedAnalyzer searchAnalyzer,
|
||||||
NamedAnalyzer searchQuotedAnalyzer, int positionOffsetGap, int ignoreAbove,
|
NamedAnalyzer searchQuotedAnalyzer, int positionOffsetGap, int ignoreAbove,
|
||||||
PostingsFormatProvider postingsFormat, DocValuesFormatProvider docValuesFormat,
|
PostingsFormatProvider postingsFormat, DocValuesFormatProvider docValuesFormat,
|
||||||
SimilarityProvider similarity, @Nullable Settings fieldDataSettings, Settings indexSettings) {
|
SimilarityProvider similarity, @Nullable Settings fieldDataSettings, Settings indexSettings) {
|
||||||
super(names, boost, fieldType, indexAnalyzer, searchAnalyzer, postingsFormat, docValuesFormat, similarity, fieldDataSettings, indexSettings);
|
super(names, boost, fieldType, docValues, indexAnalyzer, searchAnalyzer, postingsFormat, docValuesFormat, similarity, fieldDataSettings, indexSettings);
|
||||||
if (fieldType.tokenized() && fieldType.indexed() && hasDocValues()) {
|
if (fieldType.tokenized() && fieldType.indexed() && hasDocValues()) {
|
||||||
throw new MapperParsingException("Field [" + names.fullName() + "] cannot be analyzed and have doc values");
|
throw new MapperParsingException("Field [" + names.fullName() + "] cannot be analyzed and have doc values");
|
||||||
}
|
}
|
||||||
|
|
|
@ -78,7 +78,7 @@ public class TokenCountFieldMapper extends IntegerFieldMapper {
|
||||||
@Override
|
@Override
|
||||||
public TokenCountFieldMapper build(BuilderContext context) {
|
public TokenCountFieldMapper build(BuilderContext context) {
|
||||||
fieldType.setOmitNorms(fieldType.omitNorms() && boost == 1.0f);
|
fieldType.setOmitNorms(fieldType.omitNorms() && boost == 1.0f);
|
||||||
TokenCountFieldMapper fieldMapper = new TokenCountFieldMapper(buildNames(context), precisionStep, boost, fieldType, nullValue,
|
TokenCountFieldMapper fieldMapper = new TokenCountFieldMapper(buildNames(context), precisionStep, boost, fieldType, docValues, nullValue,
|
||||||
ignoreMalformed(context), postingsProvider, docValuesProvider, similarity, fieldDataSettings, context.indexSettings(),
|
ignoreMalformed(context), postingsProvider, docValuesProvider, similarity, fieldDataSettings, context.indexSettings(),
|
||||||
analyzer);
|
analyzer);
|
||||||
fieldMapper.includeInAll(includeInAll);
|
fieldMapper.includeInAll(includeInAll);
|
||||||
|
@ -114,10 +114,10 @@ public class TokenCountFieldMapper extends IntegerFieldMapper {
|
||||||
|
|
||||||
private NamedAnalyzer analyzer;
|
private NamedAnalyzer analyzer;
|
||||||
|
|
||||||
protected TokenCountFieldMapper(Names names, int precisionStep, float boost, FieldType fieldType, Integer nullValue,
|
protected TokenCountFieldMapper(Names names, int precisionStep, float boost, FieldType fieldType, Boolean docValues, Integer nullValue,
|
||||||
Explicit<Boolean> ignoreMalformed, PostingsFormatProvider postingsProvider, DocValuesFormatProvider docValuesProvider,
|
Explicit<Boolean> ignoreMalformed, PostingsFormatProvider postingsProvider, DocValuesFormatProvider docValuesProvider,
|
||||||
SimilarityProvider similarity, Settings fieldDataSettings, Settings indexSettings, NamedAnalyzer analyzer) {
|
SimilarityProvider similarity, Settings fieldDataSettings, Settings indexSettings, NamedAnalyzer analyzer) {
|
||||||
super(names, precisionStep, boost, fieldType, nullValue, ignoreMalformed, postingsProvider, docValuesProvider, similarity,
|
super(names, precisionStep, boost, fieldType, docValues, nullValue, ignoreMalformed, postingsProvider, docValuesProvider, similarity,
|
||||||
fieldDataSettings, indexSettings);
|
fieldDataSettings, indexSettings);
|
||||||
this.analyzer = analyzer;
|
this.analyzer = analyzer;
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,6 +42,7 @@ import static org.elasticsearch.index.mapper.FieldMapper.DOC_VALUES_FORMAT;
|
||||||
*/
|
*/
|
||||||
public class TypeParsers {
|
public class TypeParsers {
|
||||||
|
|
||||||
|
public static final String DOC_VALUES = "doc_values";
|
||||||
public static final String INDEX_OPTIONS_DOCS = "docs";
|
public static final String INDEX_OPTIONS_DOCS = "docs";
|
||||||
public static final String INDEX_OPTIONS_FREQS = "freqs";
|
public static final String INDEX_OPTIONS_FREQS = "freqs";
|
||||||
public static final String INDEX_OPTIONS_POSITIONS = "positions";
|
public static final String INDEX_OPTIONS_POSITIONS = "positions";
|
||||||
|
@ -76,6 +77,8 @@ public class TypeParsers {
|
||||||
parseIndex(name, propNode.toString(), builder);
|
parseIndex(name, propNode.toString(), builder);
|
||||||
} else if (propName.equals("tokenized")) {
|
} else if (propName.equals("tokenized")) {
|
||||||
builder.tokenized(nodeBooleanValue(propNode));
|
builder.tokenized(nodeBooleanValue(propNode));
|
||||||
|
} else if (propName.equals(DOC_VALUES)) {
|
||||||
|
builder.docValues(nodeBooleanValue(propNode));
|
||||||
} else if (propName.equals("term_vector")) {
|
} else if (propName.equals("term_vector")) {
|
||||||
parseTermVector(name, propNode.toString(), builder);
|
parseTermVector(name, propNode.toString(), builder);
|
||||||
} else if (propName.equals("boost")) {
|
} else if (propName.equals("boost")) {
|
||||||
|
|
|
@ -196,7 +196,7 @@ public class GeoPointFieldMapper extends AbstractFieldMapper<GeoPoint> implement
|
||||||
// store them as a single token.
|
// store them as a single token.
|
||||||
fieldType.setTokenized(false);
|
fieldType.setTokenized(false);
|
||||||
|
|
||||||
return new GeoPointFieldMapper(buildNames(context), fieldType, indexAnalyzer, searchAnalyzer, postingsProvider, docValuesProvider, similarity, fieldDataSettings, context.indexSettings(), origPathType, enableLatLon, enableGeoHash, enableGeohashPrefix, precisionStep, geoHashPrecision, latMapper, lonMapper, geohashMapper, validateLon, validateLat, normalizeLon, normalizeLat);
|
return new GeoPointFieldMapper(buildNames(context), fieldType, docValues, indexAnalyzer, searchAnalyzer, postingsProvider, docValuesProvider, similarity, fieldDataSettings, context.indexSettings(), origPathType, enableLatLon, enableGeoHash, enableGeohashPrefix, precisionStep, geoHashPrecision, latMapper, lonMapper, geohashMapper, validateLon, validateLat, normalizeLon, normalizeLat);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -392,7 +392,7 @@ public class GeoPointFieldMapper extends AbstractFieldMapper<GeoPoint> implement
|
||||||
private final boolean normalizeLon;
|
private final boolean normalizeLon;
|
||||||
private final boolean normalizeLat;
|
private final boolean normalizeLat;
|
||||||
|
|
||||||
public GeoPointFieldMapper(FieldMapper.Names names, FieldType fieldType,
|
public GeoPointFieldMapper(FieldMapper.Names names, FieldType fieldType, Boolean docValues,
|
||||||
NamedAnalyzer indexAnalyzer, NamedAnalyzer searchAnalyzer,
|
NamedAnalyzer indexAnalyzer, NamedAnalyzer searchAnalyzer,
|
||||||
PostingsFormatProvider postingsFormat, DocValuesFormatProvider docValuesFormat,
|
PostingsFormatProvider postingsFormat, DocValuesFormatProvider docValuesFormat,
|
||||||
SimilarityProvider similarity, @Nullable Settings fieldDataSettings, Settings indexSettings,
|
SimilarityProvider similarity, @Nullable Settings fieldDataSettings, Settings indexSettings,
|
||||||
|
@ -400,7 +400,7 @@ public class GeoPointFieldMapper extends AbstractFieldMapper<GeoPoint> implement
|
||||||
DoubleFieldMapper latMapper, DoubleFieldMapper lonMapper, StringFieldMapper geohashMapper,
|
DoubleFieldMapper latMapper, DoubleFieldMapper lonMapper, StringFieldMapper geohashMapper,
|
||||||
boolean validateLon, boolean validateLat,
|
boolean validateLon, boolean validateLat,
|
||||||
boolean normalizeLon, boolean normalizeLat) {
|
boolean normalizeLon, boolean normalizeLat) {
|
||||||
super(names, 1f, fieldType, null, indexAnalyzer, postingsFormat, docValuesFormat, similarity, fieldDataSettings, indexSettings);
|
super(names, 1f, fieldType, docValues, null, indexAnalyzer, postingsFormat, docValuesFormat, similarity, fieldDataSettings, indexSettings);
|
||||||
this.pathType = pathType;
|
this.pathType = pathType;
|
||||||
this.enableLatLon = enableLatLon;
|
this.enableLatLon = enableLatLon;
|
||||||
this.enableGeoHash = enableGeoHash || enableGeohashPrefix; // implicitly enable geohashes if geohash_prefix is set
|
this.enableGeoHash = enableGeoHash || enableGeohashPrefix; // implicitly enable geohashes if geohash_prefix is set
|
||||||
|
|
|
@ -196,7 +196,7 @@ public class GeoShapeFieldMapper extends AbstractFieldMapper<String> {
|
||||||
|
|
||||||
public GeoShapeFieldMapper(FieldMapper.Names names, SpatialPrefixTree tree, String defaultStrategyName, double distanceErrorPct,
|
public GeoShapeFieldMapper(FieldMapper.Names names, SpatialPrefixTree tree, String defaultStrategyName, double distanceErrorPct,
|
||||||
FieldType fieldType, PostingsFormatProvider postingsProvider, DocValuesFormatProvider docValuesProvider) {
|
FieldType fieldType, PostingsFormatProvider postingsProvider, DocValuesFormatProvider docValuesProvider) {
|
||||||
super(names, 1, fieldType, null, null, postingsProvider, docValuesProvider, null, null, null);
|
super(names, 1, fieldType, null, null, null, postingsProvider, docValuesProvider, null, null, null);
|
||||||
this.recursiveStrategy = new RecursivePrefixTreeStrategy(tree, names.indexName());
|
this.recursiveStrategy = new RecursivePrefixTreeStrategy(tree, names.indexName());
|
||||||
this.recursiveStrategy.setDistErrPct(distanceErrorPct);
|
this.recursiveStrategy.setDistErrPct(distanceErrorPct);
|
||||||
this.termStrategy = new TermQueryPrefixTreeStrategy(tree, names.indexName());
|
this.termStrategy = new TermQueryPrefixTreeStrategy(tree, names.indexName());
|
||||||
|
|
|
@ -145,7 +145,7 @@ public class AllFieldMapper extends AbstractFieldMapper<Void> implements Interna
|
||||||
boolean enabled, boolean autoBoost, PostingsFormatProvider postingsProvider,
|
boolean enabled, boolean autoBoost, PostingsFormatProvider postingsProvider,
|
||||||
DocValuesFormatProvider docValuesProvider, SimilarityProvider similarity, @Nullable Settings fieldDataSettings,
|
DocValuesFormatProvider docValuesProvider, SimilarityProvider similarity, @Nullable Settings fieldDataSettings,
|
||||||
Settings indexSettings) {
|
Settings indexSettings) {
|
||||||
super(new Names(name, name, name, name), 1.0f, fieldType, indexAnalyzer, searchAnalyzer, postingsProvider, docValuesProvider,
|
super(new Names(name, name, name, name), 1.0f, fieldType, null, indexAnalyzer, searchAnalyzer, postingsProvider, docValuesProvider,
|
||||||
similarity, fieldDataSettings, indexSettings);
|
similarity, fieldDataSettings, indexSettings);
|
||||||
this.enabled = enabled;
|
this.enabled = enabled;
|
||||||
this.autoBoost = autoBoost;
|
this.autoBoost = autoBoost;
|
||||||
|
|
|
@ -90,7 +90,7 @@ public class BoostFieldMapper extends NumberFieldMapper<Float> implements Intern
|
||||||
@Override
|
@Override
|
||||||
public BoostFieldMapper build(BuilderContext context) {
|
public BoostFieldMapper build(BuilderContext context) {
|
||||||
return new BoostFieldMapper(name, buildIndexName(context),
|
return new BoostFieldMapper(name, buildIndexName(context),
|
||||||
precisionStep, boost, fieldType, nullValue, postingsProvider, docValuesProvider, fieldDataSettings, context.indexSettings());
|
precisionStep, boost, fieldType, docValues, nullValue, postingsProvider, docValuesProvider, fieldDataSettings, context.indexSettings());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -118,13 +118,13 @@ public class BoostFieldMapper extends NumberFieldMapper<Float> implements Intern
|
||||||
}
|
}
|
||||||
|
|
||||||
protected BoostFieldMapper(String name, String indexName) {
|
protected BoostFieldMapper(String name, String indexName) {
|
||||||
this(name, indexName, Defaults.PRECISION_STEP, Defaults.BOOST, new FieldType(Defaults.FIELD_TYPE),
|
this(name, indexName, Defaults.PRECISION_STEP, Defaults.BOOST, new FieldType(Defaults.FIELD_TYPE), null,
|
||||||
Defaults.NULL_VALUE, null, null, null, ImmutableSettings.EMPTY);
|
Defaults.NULL_VALUE, null, null, null, ImmutableSettings.EMPTY);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected BoostFieldMapper(String name, String indexName, int precisionStep, float boost, FieldType fieldType, Float nullValue,
|
protected BoostFieldMapper(String name, String indexName, int precisionStep, float boost, FieldType fieldType, Boolean docValues, Float nullValue,
|
||||||
PostingsFormatProvider postingsProvider, DocValuesFormatProvider docValuesProvider, @Nullable Settings fieldDataSettings, Settings indexSettings) {
|
PostingsFormatProvider postingsProvider, DocValuesFormatProvider docValuesProvider, @Nullable Settings fieldDataSettings, Settings indexSettings) {
|
||||||
super(new Names(name, indexName, indexName, name), precisionStep, boost, fieldType, Defaults.IGNORE_MALFORMED,
|
super(new Names(name, indexName, indexName, name), precisionStep, boost, fieldType, docValues, Defaults.IGNORE_MALFORMED,
|
||||||
NumericFloatAnalyzer.buildNamedAnalyzer(precisionStep), NumericFloatAnalyzer.buildNamedAnalyzer(Integer.MAX_VALUE),
|
NumericFloatAnalyzer.buildNamedAnalyzer(precisionStep), NumericFloatAnalyzer.buildNamedAnalyzer(Integer.MAX_VALUE),
|
||||||
postingsProvider, docValuesProvider, null, fieldDataSettings, indexSettings);
|
postingsProvider, docValuesProvider, null, fieldDataSettings, indexSettings);
|
||||||
this.nullValue = nullValue;
|
this.nullValue = nullValue;
|
||||||
|
|
|
@ -97,7 +97,7 @@ public class IdFieldMapper extends AbstractFieldMapper<String> implements Intern
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IdFieldMapper build(BuilderContext context) {
|
public IdFieldMapper build(BuilderContext context) {
|
||||||
return new IdFieldMapper(name, indexName, boost, fieldType, path, postingsProvider, docValuesProvider, fieldDataSettings, context.indexSettings());
|
return new IdFieldMapper(name, indexName, boost, fieldType, docValues, path, postingsProvider, docValuesProvider, fieldDataSettings, context.indexSettings());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -120,21 +120,21 @@ public class IdFieldMapper extends AbstractFieldMapper<String> implements Intern
|
||||||
private final String path;
|
private final String path;
|
||||||
|
|
||||||
public IdFieldMapper() {
|
public IdFieldMapper() {
|
||||||
this(Defaults.NAME, Defaults.INDEX_NAME, new FieldType(Defaults.FIELD_TYPE));
|
this(new FieldType(Defaults.FIELD_TYPE));
|
||||||
}
|
}
|
||||||
|
|
||||||
public IdFieldMapper(FieldType fieldType) {
|
public IdFieldMapper(FieldType fieldType) {
|
||||||
this(Defaults.NAME, Defaults.INDEX_NAME, fieldType);
|
this(Defaults.NAME, Defaults.INDEX_NAME, fieldType, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected IdFieldMapper(String name, String indexName, FieldType fieldType) {
|
protected IdFieldMapper(String name, String indexName, FieldType fieldType, Boolean docValues) {
|
||||||
this(name, indexName, Defaults.BOOST, fieldType, Defaults.PATH, null, null, null, ImmutableSettings.EMPTY);
|
this(name, indexName, Defaults.BOOST, fieldType, docValues, Defaults.PATH, null, null, null, ImmutableSettings.EMPTY);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected IdFieldMapper(String name, String indexName, float boost, FieldType fieldType, String path,
|
protected IdFieldMapper(String name, String indexName, float boost, FieldType fieldType, Boolean docValues, String path,
|
||||||
PostingsFormatProvider postingsProvider, DocValuesFormatProvider docValuesProvider,
|
PostingsFormatProvider postingsProvider, DocValuesFormatProvider docValuesProvider,
|
||||||
@Nullable Settings fieldDataSettings, Settings indexSettings) {
|
@Nullable Settings fieldDataSettings, Settings indexSettings) {
|
||||||
super(new Names(name, indexName, indexName, name), boost, fieldType, Lucene.KEYWORD_ANALYZER,
|
super(new Names(name, indexName, indexName, name), boost, fieldType, docValues, Lucene.KEYWORD_ANALYZER,
|
||||||
Lucene.KEYWORD_ANALYZER, postingsProvider, docValuesProvider, null, fieldDataSettings, indexSettings);
|
Lucene.KEYWORD_ANALYZER, postingsProvider, docValuesProvider, null, fieldDataSettings, indexSettings);
|
||||||
this.path = path;
|
this.path = path;
|
||||||
}
|
}
|
||||||
|
|
|
@ -85,7 +85,7 @@ public class IndexFieldMapper extends AbstractFieldMapper<String> implements Int
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IndexFieldMapper build(BuilderContext context) {
|
public IndexFieldMapper build(BuilderContext context) {
|
||||||
return new IndexFieldMapper(name, indexName, boost, fieldType, enabledState, postingsProvider, docValuesProvider, fieldDataSettings, context.indexSettings());
|
return new IndexFieldMapper(name, indexName, boost, fieldType, docValues, enabledState, postingsProvider, docValuesProvider, fieldDataSettings, context.indexSettings());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -114,12 +114,12 @@ public class IndexFieldMapper extends AbstractFieldMapper<String> implements Int
|
||||||
}
|
}
|
||||||
|
|
||||||
protected IndexFieldMapper(String name, String indexName) {
|
protected IndexFieldMapper(String name, String indexName) {
|
||||||
this(name, indexName, Defaults.BOOST, new FieldType(Defaults.FIELD_TYPE), Defaults.ENABLED_STATE, null, null, null, ImmutableSettings.EMPTY);
|
this(name, indexName, Defaults.BOOST, new FieldType(Defaults.FIELD_TYPE), null, Defaults.ENABLED_STATE, null, null, null, ImmutableSettings.EMPTY);
|
||||||
}
|
}
|
||||||
|
|
||||||
public IndexFieldMapper(String name, String indexName, float boost, FieldType fieldType, EnabledAttributeMapper enabledState,
|
public IndexFieldMapper(String name, String indexName, float boost, FieldType fieldType, Boolean docValues, EnabledAttributeMapper enabledState,
|
||||||
PostingsFormatProvider postingsProvider, DocValuesFormatProvider docValuesProvider, @Nullable Settings fieldDataSettings, Settings indexSettings) {
|
PostingsFormatProvider postingsProvider, DocValuesFormatProvider docValuesProvider, @Nullable Settings fieldDataSettings, Settings indexSettings) {
|
||||||
super(new Names(name, indexName, indexName, name), boost, fieldType, Lucene.KEYWORD_ANALYZER,
|
super(new Names(name, indexName, indexName, name), boost, fieldType, docValues, Lucene.KEYWORD_ANALYZER,
|
||||||
Lucene.KEYWORD_ANALYZER, postingsProvider, docValuesProvider, null, fieldDataSettings, indexSettings);
|
Lucene.KEYWORD_ANALYZER, postingsProvider, docValuesProvider, null, fieldDataSettings, indexSettings);
|
||||||
this.enabledState = enabledState;
|
this.enabledState = enabledState;
|
||||||
}
|
}
|
||||||
|
|
|
@ -126,17 +126,14 @@ public class ParentFieldMapper extends AbstractFieldMapper<Uid> implements Inter
|
||||||
private final BytesRef typeAsBytes;
|
private final BytesRef typeAsBytes;
|
||||||
|
|
||||||
protected ParentFieldMapper(String name, String indexName, String type, PostingsFormatProvider postingsFormat, @Nullable Settings fieldDataSettings, Settings indexSettings) {
|
protected ParentFieldMapper(String name, String indexName, String type, PostingsFormatProvider postingsFormat, @Nullable Settings fieldDataSettings, Settings indexSettings) {
|
||||||
super(new Names(name, indexName, indexName, name), Defaults.BOOST, new FieldType(Defaults.FIELD_TYPE),
|
super(new Names(name, indexName, indexName, name), Defaults.BOOST, new FieldType(Defaults.FIELD_TYPE), null,
|
||||||
Lucene.KEYWORD_ANALYZER, Lucene.KEYWORD_ANALYZER, postingsFormat, null, null, fieldDataSettings, indexSettings);
|
Lucene.KEYWORD_ANALYZER, Lucene.KEYWORD_ANALYZER, postingsFormat, null, null, fieldDataSettings, indexSettings);
|
||||||
this.type = type;
|
this.type = type;
|
||||||
this.typeAsBytes = new BytesRef(type);
|
this.typeAsBytes = type == null ? null : new BytesRef(type);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ParentFieldMapper() {
|
public ParentFieldMapper() {
|
||||||
super(new Names(Defaults.NAME, Defaults.NAME, Defaults.NAME, Defaults.NAME), Defaults.BOOST, new FieldType(Defaults.FIELD_TYPE),
|
this(Defaults.NAME, Defaults.NAME, null, null, null, null);
|
||||||
Lucene.KEYWORD_ANALYZER, Lucene.KEYWORD_ANALYZER, null, null, null, null, null);
|
|
||||||
type = null;
|
|
||||||
typeAsBytes = null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public String type() {
|
public String type() {
|
||||||
|
|
|
@ -125,7 +125,7 @@ public class RoutingFieldMapper extends AbstractFieldMapper<String> implements I
|
||||||
|
|
||||||
protected RoutingFieldMapper(FieldType fieldType, boolean required, String path, PostingsFormatProvider postingsProvider,
|
protected RoutingFieldMapper(FieldType fieldType, boolean required, String path, PostingsFormatProvider postingsProvider,
|
||||||
DocValuesFormatProvider docValuesProvider, @Nullable Settings fieldDataSettings, Settings indexSettings) {
|
DocValuesFormatProvider docValuesProvider, @Nullable Settings fieldDataSettings, Settings indexSettings) {
|
||||||
super(new Names(Defaults.NAME, Defaults.NAME, Defaults.NAME, Defaults.NAME), 1.0f, fieldType, Lucene.KEYWORD_ANALYZER,
|
super(new Names(Defaults.NAME, Defaults.NAME, Defaults.NAME, Defaults.NAME), 1.0f, fieldType, null, Lucene.KEYWORD_ANALYZER,
|
||||||
Lucene.KEYWORD_ANALYZER, postingsProvider, docValuesProvider, null, fieldDataSettings, indexSettings);
|
Lucene.KEYWORD_ANALYZER, postingsProvider, docValuesProvider, null, fieldDataSettings, indexSettings);
|
||||||
this.required = required;
|
this.required = required;
|
||||||
this.path = path;
|
this.path = path;
|
||||||
|
|
|
@ -101,7 +101,7 @@ public class SizeFieldMapper extends IntegerFieldMapper implements RootMapper {
|
||||||
|
|
||||||
public SizeFieldMapper(EnabledAttributeMapper enabled, FieldType fieldType, PostingsFormatProvider postingsProvider,
|
public SizeFieldMapper(EnabledAttributeMapper enabled, FieldType fieldType, PostingsFormatProvider postingsProvider,
|
||||||
DocValuesFormatProvider docValuesProvider, @Nullable Settings fieldDataSettings, Settings indexSettings) {
|
DocValuesFormatProvider docValuesProvider, @Nullable Settings fieldDataSettings, Settings indexSettings) {
|
||||||
super(new Names(Defaults.NAME), Defaults.PRECISION_STEP, Defaults.BOOST, fieldType, Defaults.NULL_VALUE,
|
super(new Names(Defaults.NAME), Defaults.PRECISION_STEP, Defaults.BOOST, fieldType, null, Defaults.NULL_VALUE,
|
||||||
Defaults.IGNORE_MALFORMED, postingsProvider, docValuesProvider, null, fieldDataSettings, indexSettings);
|
Defaults.IGNORE_MALFORMED, postingsProvider, docValuesProvider, null, fieldDataSettings, indexSettings);
|
||||||
this.enabledState = enabled;
|
this.enabledState = enabled;
|
||||||
}
|
}
|
||||||
|
|
|
@ -195,7 +195,7 @@ public class SourceFieldMapper extends AbstractFieldMapper<byte[]> implements In
|
||||||
|
|
||||||
protected SourceFieldMapper(String name, boolean enabled, String format, Boolean compress, long compressThreshold,
|
protected SourceFieldMapper(String name, boolean enabled, String format, Boolean compress, long compressThreshold,
|
||||||
String[] includes, String[] excludes) {
|
String[] includes, String[] excludes) {
|
||||||
super(new Names(name, name, name, name), Defaults.BOOST, new FieldType(Defaults.FIELD_TYPE),
|
super(new Names(name, name, name, name), Defaults.BOOST, new FieldType(Defaults.FIELD_TYPE), null,
|
||||||
Lucene.KEYWORD_ANALYZER, Lucene.KEYWORD_ANALYZER, null, null, null, null, null); // Only stored.
|
Lucene.KEYWORD_ANALYZER, Lucene.KEYWORD_ANALYZER, null, null, null, null, null); // Only stored.
|
||||||
this.enabled = enabled;
|
this.enabled = enabled;
|
||||||
this.compress = compress;
|
this.compress = compress;
|
||||||
|
|
|
@ -126,7 +126,7 @@ public class TTLFieldMapper extends LongFieldMapper implements InternalMapper, R
|
||||||
PostingsFormatProvider postingsProvider, DocValuesFormatProvider docValuesProvider,
|
PostingsFormatProvider postingsProvider, DocValuesFormatProvider docValuesProvider,
|
||||||
@Nullable Settings fieldDataSettings, Settings indexSettings) {
|
@Nullable Settings fieldDataSettings, Settings indexSettings) {
|
||||||
super(new Names(Defaults.NAME, Defaults.NAME, Defaults.NAME, Defaults.NAME), Defaults.PRECISION_STEP,
|
super(new Names(Defaults.NAME, Defaults.NAME, Defaults.NAME, Defaults.NAME), Defaults.PRECISION_STEP,
|
||||||
Defaults.BOOST, fieldType, Defaults.NULL_VALUE, ignoreMalformed,
|
Defaults.BOOST, fieldType, null, Defaults.NULL_VALUE, ignoreMalformed,
|
||||||
postingsProvider, docValuesProvider, null, fieldDataSettings, indexSettings);
|
postingsProvider, docValuesProvider, null, fieldDataSettings, indexSettings);
|
||||||
this.enabledState = enabled;
|
this.enabledState = enabled;
|
||||||
this.defaultTTL = defaultTTL;
|
this.defaultTTL = defaultTTL;
|
||||||
|
|
|
@ -104,7 +104,7 @@ public class TimestampFieldMapper extends DateFieldMapper implements InternalMap
|
||||||
Settings settings = context.indexSettings();
|
Settings settings = context.indexSettings();
|
||||||
roundCeil = settings.getAsBoolean("index.mapping.date.round_ceil", settings.getAsBoolean("index.mapping.date.parse_upper_inclusive", Defaults.ROUND_CEIL));
|
roundCeil = settings.getAsBoolean("index.mapping.date.round_ceil", settings.getAsBoolean("index.mapping.date.parse_upper_inclusive", Defaults.ROUND_CEIL));
|
||||||
}
|
}
|
||||||
return new TimestampFieldMapper(fieldType, enabledState, path, dateTimeFormatter, roundCeil,
|
return new TimestampFieldMapper(fieldType, docValues, enabledState, path, dateTimeFormatter, roundCeil,
|
||||||
ignoreMalformed(context), postingsProvider, docValuesProvider, fieldDataSettings, context.indexSettings());
|
ignoreMalformed(context), postingsProvider, docValuesProvider, fieldDataSettings, context.indexSettings());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -136,17 +136,17 @@ public class TimestampFieldMapper extends DateFieldMapper implements InternalMap
|
||||||
private final String path;
|
private final String path;
|
||||||
|
|
||||||
public TimestampFieldMapper() {
|
public TimestampFieldMapper() {
|
||||||
this(new FieldType(Defaults.FIELD_TYPE), Defaults.ENABLED, Defaults.PATH, Defaults.DATE_TIME_FORMATTER,
|
this(new FieldType(Defaults.FIELD_TYPE), null, Defaults.ENABLED, Defaults.PATH, Defaults.DATE_TIME_FORMATTER,
|
||||||
Defaults.ROUND_CEIL, Defaults.IGNORE_MALFORMED, null, null, null, ImmutableSettings.EMPTY);
|
Defaults.ROUND_CEIL, Defaults.IGNORE_MALFORMED, null, null, null, ImmutableSettings.EMPTY);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected TimestampFieldMapper(FieldType fieldType, EnabledAttributeMapper enabledState, String path,
|
protected TimestampFieldMapper(FieldType fieldType, Boolean docValues, EnabledAttributeMapper enabledState, String path,
|
||||||
FormatDateTimeFormatter dateTimeFormatter, boolean roundCeil,
|
FormatDateTimeFormatter dateTimeFormatter, boolean roundCeil,
|
||||||
Explicit<Boolean> ignoreMalformed, PostingsFormatProvider postingsProvider,
|
Explicit<Boolean> ignoreMalformed, PostingsFormatProvider postingsProvider,
|
||||||
DocValuesFormatProvider docValuesProvider, @Nullable Settings fieldDataSettings,
|
DocValuesFormatProvider docValuesProvider, @Nullable Settings fieldDataSettings,
|
||||||
Settings indexSettings) {
|
Settings indexSettings) {
|
||||||
super(new Names(Defaults.NAME, Defaults.NAME, Defaults.NAME, Defaults.NAME), dateTimeFormatter,
|
super(new Names(Defaults.NAME, Defaults.NAME, Defaults.NAME, Defaults.NAME), dateTimeFormatter,
|
||||||
Defaults.PRECISION_STEP, Defaults.BOOST, fieldType,
|
Defaults.PRECISION_STEP, Defaults.BOOST, fieldType, docValues,
|
||||||
Defaults.NULL_VALUE, TimeUnit.MILLISECONDS /*always milliseconds*/,
|
Defaults.NULL_VALUE, TimeUnit.MILLISECONDS /*always milliseconds*/,
|
||||||
roundCeil, ignoreMalformed, postingsProvider, docValuesProvider, null, fieldDataSettings, indexSettings);
|
roundCeil, ignoreMalformed, postingsProvider, docValuesProvider, null, fieldDataSettings, indexSettings);
|
||||||
this.enabledState = enabledState;
|
this.enabledState = enabledState;
|
||||||
|
|
|
@ -108,7 +108,7 @@ public class TypeFieldMapper extends AbstractFieldMapper<String> implements Inte
|
||||||
|
|
||||||
public TypeFieldMapper(String name, String indexName, float boost, FieldType fieldType, PostingsFormatProvider postingsProvider,
|
public TypeFieldMapper(String name, String indexName, float boost, FieldType fieldType, PostingsFormatProvider postingsProvider,
|
||||||
DocValuesFormatProvider docValuesProvider, @Nullable Settings fieldDataSettings, Settings indexSettings) {
|
DocValuesFormatProvider docValuesProvider, @Nullable Settings fieldDataSettings, Settings indexSettings) {
|
||||||
super(new Names(name, indexName, indexName, name), boost, fieldType, Lucene.KEYWORD_ANALYZER,
|
super(new Names(name, indexName, indexName, name), boost, fieldType, null, Lucene.KEYWORD_ANALYZER,
|
||||||
Lucene.KEYWORD_ANALYZER, postingsProvider, docValuesProvider, null, fieldDataSettings, indexSettings);
|
Lucene.KEYWORD_ANALYZER, postingsProvider, docValuesProvider, null, fieldDataSettings, indexSettings);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -86,7 +86,7 @@ public class UidFieldMapper extends AbstractFieldMapper<Uid> implements Internal
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public UidFieldMapper build(BuilderContext context) {
|
public UidFieldMapper build(BuilderContext context) {
|
||||||
return new UidFieldMapper(name, indexName, postingsProvider, docValuesProvider, fieldDataSettings, context.indexSettings());
|
return new UidFieldMapper(name, indexName, docValues, postingsProvider, docValuesProvider, fieldDataSettings, context.indexSettings());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -104,11 +104,11 @@ public class UidFieldMapper extends AbstractFieldMapper<Uid> implements Internal
|
||||||
}
|
}
|
||||||
|
|
||||||
protected UidFieldMapper(String name) {
|
protected UidFieldMapper(String name) {
|
||||||
this(name, name, null, null, null, ImmutableSettings.EMPTY);
|
this(name, name, null, null, null, null, ImmutableSettings.EMPTY);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected UidFieldMapper(String name, String indexName, PostingsFormatProvider postingsFormat, DocValuesFormatProvider docValuesFormat, @Nullable Settings fieldDataSettings, Settings indexSettings) {
|
protected UidFieldMapper(String name, String indexName, Boolean docValues, PostingsFormatProvider postingsFormat, DocValuesFormatProvider docValuesFormat, @Nullable Settings fieldDataSettings, Settings indexSettings) {
|
||||||
super(new Names(name, indexName, indexName, name), Defaults.BOOST, new FieldType(Defaults.FIELD_TYPE),
|
super(new Names(name, indexName, indexName, name), Defaults.BOOST, new FieldType(Defaults.FIELD_TYPE), docValues,
|
||||||
Lucene.KEYWORD_ANALYZER, Lucene.KEYWORD_ANALYZER, postingsFormat, docValuesFormat, null, fieldDataSettings, indexSettings);
|
Lucene.KEYWORD_ANALYZER, Lucene.KEYWORD_ANALYZER, postingsFormat, docValuesFormat, null, fieldDataSettings, indexSettings);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -99,7 +99,7 @@ public class VersionFieldMapper extends AbstractFieldMapper<Long> implements Int
|
||||||
}
|
}
|
||||||
|
|
||||||
VersionFieldMapper(DocValuesFormatProvider docValuesFormat) {
|
VersionFieldMapper(DocValuesFormatProvider docValuesFormat) {
|
||||||
super(new Names(NAME, NAME, NAME, NAME), Defaults.BOOST, Defaults.FIELD_TYPE, null, null, null, docValuesFormat, null, null, ImmutableSettings.EMPTY);
|
super(new Names(NAME, NAME, NAME, NAME), Defaults.BOOST, Defaults.FIELD_TYPE, null, null, null, null, docValuesFormat, null, null, ImmutableSettings.EMPTY);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -121,7 +121,7 @@ public class IpFieldMapper extends NumberFieldMapper<Long> {
|
||||||
public IpFieldMapper build(BuilderContext context) {
|
public IpFieldMapper build(BuilderContext context) {
|
||||||
fieldType.setOmitNorms(fieldType.omitNorms() && boost == 1.0f);
|
fieldType.setOmitNorms(fieldType.omitNorms() && boost == 1.0f);
|
||||||
IpFieldMapper fieldMapper = new IpFieldMapper(buildNames(context),
|
IpFieldMapper fieldMapper = new IpFieldMapper(buildNames(context),
|
||||||
precisionStep, boost, fieldType, nullValue, ignoreMalformed(context), postingsProvider, docValuesProvider, similarity,
|
precisionStep, boost, fieldType, docValues, nullValue, ignoreMalformed(context), postingsProvider, docValuesProvider, similarity,
|
||||||
fieldDataSettings, context.indexSettings());
|
fieldDataSettings, context.indexSettings());
|
||||||
fieldMapper.includeInAll(includeInAll);
|
fieldMapper.includeInAll(includeInAll);
|
||||||
return fieldMapper;
|
return fieldMapper;
|
||||||
|
@ -146,11 +146,11 @@ public class IpFieldMapper extends NumberFieldMapper<Long> {
|
||||||
|
|
||||||
private String nullValue;
|
private String nullValue;
|
||||||
|
|
||||||
protected IpFieldMapper(Names names, int precisionStep, float boost, FieldType fieldType,
|
protected IpFieldMapper(Names names, int precisionStep, float boost, FieldType fieldType, Boolean docValues,
|
||||||
String nullValue, Explicit<Boolean> ignoreMalformed,
|
String nullValue, Explicit<Boolean> ignoreMalformed,
|
||||||
PostingsFormatProvider postingsProvider, DocValuesFormatProvider docValuesProvider,
|
PostingsFormatProvider postingsProvider, DocValuesFormatProvider docValuesProvider,
|
||||||
SimilarityProvider similarity, @Nullable Settings fieldDataSettings, Settings indexSettings) {
|
SimilarityProvider similarity, @Nullable Settings fieldDataSettings, Settings indexSettings) {
|
||||||
super(names, precisionStep, boost, fieldType,
|
super(names, precisionStep, boost, fieldType, docValues,
|
||||||
ignoreMalformed, new NamedAnalyzer("_ip/" + precisionStep, new NumericIpAnalyzer(precisionStep)),
|
ignoreMalformed, new NamedAnalyzer("_ip/" + precisionStep, new NumericIpAnalyzer(precisionStep)),
|
||||||
new NamedAnalyzer("_ip/max", new NumericIpAnalyzer(Integer.MAX_VALUE)), postingsProvider, docValuesProvider,
|
new NamedAnalyzer("_ip/max", new NumericIpAnalyzer(Integer.MAX_VALUE)), postingsProvider, docValuesProvider,
|
||||||
similarity, fieldDataSettings, indexSettings);
|
similarity, fieldDataSettings, indexSettings);
|
||||||
|
|
|
@ -224,6 +224,10 @@ public class SimpleStringMappingTests extends ElasticsearchTestCase {
|
||||||
new StringFieldMapper.Builder("anything").tokenized(false).fieldDataSettings(DOC_VALUES_SETTINGS).build(ctx);
|
new StringFieldMapper.Builder("anything").tokenized(false).fieldDataSettings(DOC_VALUES_SETTINGS).build(ctx);
|
||||||
new StringFieldMapper.Builder("anything").index(false).fieldDataSettings(DOC_VALUES_SETTINGS).build(ctx);
|
new StringFieldMapper.Builder("anything").index(false).fieldDataSettings(DOC_VALUES_SETTINGS).build(ctx);
|
||||||
|
|
||||||
|
assertFalse(new StringFieldMapper.Builder("anything").index(false).build(ctx).hasDocValues());
|
||||||
|
assertTrue(new StringFieldMapper.Builder("anything").index(false).fieldDataSettings(DOC_VALUES_SETTINGS).build(ctx).hasDocValues());
|
||||||
|
assertTrue(new StringFieldMapper.Builder("anything").index(false).docValues(true).build(ctx).hasDocValues());
|
||||||
|
|
||||||
String mapping = XContentFactory.jsonBuilder().startObject().startObject("type")
|
String mapping = XContentFactory.jsonBuilder().startObject().startObject("type")
|
||||||
.startObject("properties")
|
.startObject("properties")
|
||||||
.startObject("str1")
|
.startObject("str1")
|
||||||
|
|
Loading…
Reference in New Issue