diff --git a/src/main/java/org/elasticsearch/common/Explicit.java b/src/main/java/org/elasticsearch/common/Explicit.java new file mode 100644 index 00000000000..dd7d67a92c8 --- /dev/null +++ b/src/main/java/org/elasticsearch/common/Explicit.java @@ -0,0 +1,41 @@ +/* + * Licensed to ElasticSearch and Shay Banon under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. ElasticSearch licenses this + * file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.elasticsearch.common; + +/** + */ +public class Explicit { + + private final T value; + private final boolean explicit; + + public Explicit(T value, boolean explicit) { + this.value = value; + this.explicit = explicit; + } + + public T value() { + return this.value; + } + + public boolean explicit() { + return this.explicit; + } +} diff --git a/src/main/java/org/elasticsearch/index/mapper/core/ByteFieldMapper.java b/src/main/java/org/elasticsearch/index/mapper/core/ByteFieldMapper.java index c8bb5553529..a6acef2e02f 100644 --- a/src/main/java/org/elasticsearch/index/mapper/core/ByteFieldMapper.java +++ b/src/main/java/org/elasticsearch/index/mapper/core/ByteFieldMapper.java @@ -28,6 +28,7 @@ import org.apache.lucene.search.NumericRangeFilter; import org.apache.lucene.search.NumericRangeQuery; import org.apache.lucene.search.Query; import org.apache.lucene.util.NumericUtils; +import org.elasticsearch.common.Explicit; import org.elasticsearch.common.Nullable; import org.elasticsearch.common.Strings; import org.elasticsearch.common.xcontent.XContentBuilder; @@ -37,7 +38,6 @@ import org.elasticsearch.index.analysis.NumericIntegerAnalyzer; import org.elasticsearch.index.cache.field.data.FieldDataCache; import org.elasticsearch.index.field.data.FieldDataType; import org.elasticsearch.index.mapper.*; -import org.elasticsearch.index.mapper.core.BooleanFieldMapper.Defaults; import org.elasticsearch.index.query.QueryParseContext; import org.elasticsearch.index.search.NumericRangeFieldDataFilter; @@ -104,7 +104,7 @@ public class ByteFieldMapper extends NumberFieldMapper { protected ByteFieldMapper(Names names, int precisionStep, String fuzzyFactor, Field.Index index, Field.Store store, float boost, boolean omitNorms, IndexOptions indexOptions, - Byte nullValue, boolean ignoreMalformed) { + Byte nullValue, Explicit ignoreMalformed) { super(names, precisionStep, fuzzyFactor, index, store, boost, omitNorms, indexOptions, ignoreMalformed, new NamedAnalyzer("_byte/" + precisionStep, new NumericIntegerAnalyzer(precisionStep)), new NamedAnalyzer("_byte/max", new NumericIntegerAnalyzer(Integer.MAX_VALUE))); diff --git a/src/main/java/org/elasticsearch/index/mapper/core/DateFieldMapper.java b/src/main/java/org/elasticsearch/index/mapper/core/DateFieldMapper.java index f74d6ed8f36..4ea4255548d 100644 --- a/src/main/java/org/elasticsearch/index/mapper/core/DateFieldMapper.java +++ b/src/main/java/org/elasticsearch/index/mapper/core/DateFieldMapper.java @@ -27,6 +27,7 @@ import org.apache.lucene.search.NumericRangeFilter; import org.apache.lucene.search.NumericRangeQuery; import org.apache.lucene.search.Query; import org.apache.lucene.util.NumericUtils; +import org.elasticsearch.common.Explicit; import org.elasticsearch.common.Nullable; import org.elasticsearch.common.Numbers; import org.elasticsearch.common.Strings; @@ -41,7 +42,6 @@ import org.elasticsearch.index.analysis.NumericDateAnalyzer; import org.elasticsearch.index.cache.field.data.FieldDataCache; import org.elasticsearch.index.field.data.FieldDataType; import org.elasticsearch.index.mapper.*; -import org.elasticsearch.index.mapper.core.BooleanFieldMapper.Defaults; import org.elasticsearch.index.query.QueryParseContext; import org.elasticsearch.index.search.NumericRangeFieldDataFilter; @@ -144,7 +144,7 @@ public class DateFieldMapper extends NumberFieldMapper { protected DateFieldMapper(Names names, FormatDateTimeFormatter dateTimeFormatter, int precisionStep, String fuzzyFactor, Field.Index index, Field.Store store, float boost, boolean omitNorms, IndexOptions indexOptions, - String nullValue, TimeUnit timeUnit, boolean parseUpperInclusive, boolean ignoreMalformed) { + String nullValue, TimeUnit timeUnit, boolean parseUpperInclusive, Explicit ignoreMalformed) { super(names, precisionStep, fuzzyFactor, index, store, boost, omitNorms, indexOptions, ignoreMalformed, new NamedAnalyzer("_date/" + precisionStep, new NumericDateAnalyzer(precisionStep, dateTimeFormatter.parser())), diff --git a/src/main/java/org/elasticsearch/index/mapper/core/DoubleFieldMapper.java b/src/main/java/org/elasticsearch/index/mapper/core/DoubleFieldMapper.java index f5268c49c78..93f3b963a52 100644 --- a/src/main/java/org/elasticsearch/index/mapper/core/DoubleFieldMapper.java +++ b/src/main/java/org/elasticsearch/index/mapper/core/DoubleFieldMapper.java @@ -28,6 +28,7 @@ import org.apache.lucene.search.NumericRangeFilter; import org.apache.lucene.search.NumericRangeQuery; import org.apache.lucene.search.Query; import org.apache.lucene.util.NumericUtils; +import org.elasticsearch.common.Explicit; import org.elasticsearch.common.Nullable; import org.elasticsearch.common.Numbers; import org.elasticsearch.common.xcontent.XContentBuilder; @@ -37,7 +38,6 @@ import org.elasticsearch.index.analysis.NumericDoubleAnalyzer; import org.elasticsearch.index.cache.field.data.FieldDataCache; import org.elasticsearch.index.field.data.FieldDataType; import org.elasticsearch.index.mapper.*; -import org.elasticsearch.index.mapper.core.BooleanFieldMapper.Defaults; import org.elasticsearch.index.query.QueryParseContext; import org.elasticsearch.index.search.NumericRangeFieldDataFilter; @@ -107,7 +107,7 @@ public class DoubleFieldMapper extends NumberFieldMapper { protected DoubleFieldMapper(Names names, int precisionStep, String fuzzyFactor, Field.Index index, Field.Store store, float boost, boolean omitNorms, IndexOptions indexOptions, - Double nullValue, boolean ignoreMalformed) { + Double nullValue, Explicit ignoreMalformed) { super(names, precisionStep, fuzzyFactor, index, store, boost, omitNorms, indexOptions, ignoreMalformed, new NamedAnalyzer("_double/" + precisionStep, new NumericDoubleAnalyzer(precisionStep)), new NamedAnalyzer("_double/max", new NumericDoubleAnalyzer(Integer.MAX_VALUE))); diff --git a/src/main/java/org/elasticsearch/index/mapper/core/FloatFieldMapper.java b/src/main/java/org/elasticsearch/index/mapper/core/FloatFieldMapper.java index f923c1c9094..71225c9a41e 100644 --- a/src/main/java/org/elasticsearch/index/mapper/core/FloatFieldMapper.java +++ b/src/main/java/org/elasticsearch/index/mapper/core/FloatFieldMapper.java @@ -28,6 +28,7 @@ import org.apache.lucene.search.NumericRangeFilter; import org.apache.lucene.search.NumericRangeQuery; import org.apache.lucene.search.Query; import org.apache.lucene.util.NumericUtils; +import org.elasticsearch.common.Explicit; import org.elasticsearch.common.Nullable; import org.elasticsearch.common.Numbers; import org.elasticsearch.common.Strings; @@ -38,7 +39,6 @@ import org.elasticsearch.index.analysis.NumericFloatAnalyzer; import org.elasticsearch.index.cache.field.data.FieldDataCache; import org.elasticsearch.index.field.data.FieldDataType; import org.elasticsearch.index.mapper.*; -import org.elasticsearch.index.mapper.core.BooleanFieldMapper.Defaults; import org.elasticsearch.index.query.QueryParseContext; import org.elasticsearch.index.search.NumericRangeFieldDataFilter; @@ -106,7 +106,7 @@ public class FloatFieldMapper extends NumberFieldMapper { protected FloatFieldMapper(Names names, int precisionStep, String fuzzyFactor, Field.Index index, Field.Store store, float boost, boolean omitNorms, IndexOptions indexOptions, - Float nullValue, boolean ignoreMalformed) { + Float nullValue, Explicit ignoreMalformed) { super(names, precisionStep, fuzzyFactor, index, store, boost, omitNorms, indexOptions, ignoreMalformed, new NamedAnalyzer("_float/" + precisionStep, new NumericFloatAnalyzer(precisionStep)), new NamedAnalyzer("_float/max", new NumericFloatAnalyzer(Integer.MAX_VALUE))); diff --git a/src/main/java/org/elasticsearch/index/mapper/core/IntegerFieldMapper.java b/src/main/java/org/elasticsearch/index/mapper/core/IntegerFieldMapper.java index 8a6a897dc51..3ecb8a0f4be 100644 --- a/src/main/java/org/elasticsearch/index/mapper/core/IntegerFieldMapper.java +++ b/src/main/java/org/elasticsearch/index/mapper/core/IntegerFieldMapper.java @@ -28,6 +28,7 @@ import org.apache.lucene.search.NumericRangeFilter; import org.apache.lucene.search.NumericRangeQuery; import org.apache.lucene.search.Query; import org.apache.lucene.util.NumericUtils; +import org.elasticsearch.common.Explicit; import org.elasticsearch.common.Nullable; import org.elasticsearch.common.Numbers; import org.elasticsearch.common.Strings; @@ -38,7 +39,6 @@ import org.elasticsearch.index.analysis.NumericIntegerAnalyzer; import org.elasticsearch.index.cache.field.data.FieldDataCache; import org.elasticsearch.index.field.data.FieldDataType; import org.elasticsearch.index.mapper.*; -import org.elasticsearch.index.mapper.core.BooleanFieldMapper.Defaults; import org.elasticsearch.index.query.QueryParseContext; import org.elasticsearch.index.search.NumericRangeFieldDataFilter; @@ -106,7 +106,7 @@ public class IntegerFieldMapper extends NumberFieldMapper { protected IntegerFieldMapper(Names names, int precisionStep, String fuzzyFactor, Field.Index index, Field.Store store, float boost, boolean omitNorms, IndexOptions indexOptions, - Integer nullValue, boolean ignoreMalformed) { + Integer nullValue, Explicit ignoreMalformed) { super(names, precisionStep, fuzzyFactor, index, store, boost, omitNorms, indexOptions, ignoreMalformed, new NamedAnalyzer("_int/" + precisionStep, new NumericIntegerAnalyzer(precisionStep)), new NamedAnalyzer("_int/max", new NumericIntegerAnalyzer(Integer.MAX_VALUE))); diff --git a/src/main/java/org/elasticsearch/index/mapper/core/LongFieldMapper.java b/src/main/java/org/elasticsearch/index/mapper/core/LongFieldMapper.java index 5dad4f62de0..40d35b528ad 100644 --- a/src/main/java/org/elasticsearch/index/mapper/core/LongFieldMapper.java +++ b/src/main/java/org/elasticsearch/index/mapper/core/LongFieldMapper.java @@ -28,6 +28,7 @@ import org.apache.lucene.search.NumericRangeFilter; import org.apache.lucene.search.NumericRangeQuery; import org.apache.lucene.search.Query; import org.apache.lucene.util.NumericUtils; +import org.elasticsearch.common.Explicit; import org.elasticsearch.common.Nullable; import org.elasticsearch.common.Numbers; import org.elasticsearch.common.Strings; @@ -38,7 +39,6 @@ import org.elasticsearch.index.analysis.NumericLongAnalyzer; import org.elasticsearch.index.cache.field.data.FieldDataCache; import org.elasticsearch.index.field.data.FieldDataType; import org.elasticsearch.index.mapper.*; -import org.elasticsearch.index.mapper.core.BooleanFieldMapper.Defaults; import org.elasticsearch.index.query.QueryParseContext; import org.elasticsearch.index.search.NumericRangeFieldDataFilter; @@ -106,7 +106,7 @@ public class LongFieldMapper extends NumberFieldMapper { protected LongFieldMapper(Names names, int precisionStep, String fuzzyFactor, Field.Index index, Field.Store store, float boost, boolean omitNorms, IndexOptions indexOptions, - Long nullValue, boolean ignoreMalformed) { + Long nullValue, Explicit ignoreMalformed) { super(names, precisionStep, fuzzyFactor, index, store, boost, omitNorms, indexOptions, ignoreMalformed, new NamedAnalyzer("_long/" + precisionStep, new NumericLongAnalyzer(precisionStep)), new NamedAnalyzer("_long/max", new NumericLongAnalyzer(Integer.MAX_VALUE))); diff --git a/src/main/java/org/elasticsearch/index/mapper/core/NumberFieldMapper.java b/src/main/java/org/elasticsearch/index/mapper/core/NumberFieldMapper.java index fe3ef480183..f9403d819ce 100644 --- a/src/main/java/org/elasticsearch/index/mapper/core/NumberFieldMapper.java +++ b/src/main/java/org/elasticsearch/index/mapper/core/NumberFieldMapper.java @@ -28,6 +28,7 @@ import org.apache.lucene.index.FieldInfo.IndexOptions; import org.apache.lucene.search.Filter; import org.apache.lucene.search.Query; import org.apache.lucene.util.NumericUtils; +import org.elasticsearch.common.Explicit; import org.elasticsearch.common.Nullable; import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.index.analysis.NamedAnalyzer; @@ -51,7 +52,7 @@ public abstract class NumberFieldMapper extends AbstractFieldM public static final boolean OMIT_NORMS = true; public static final IndexOptions INDEX_OPTIONS = IndexOptions.DOCS_ONLY; public static final String FUZZY_FACTOR = null; - public static final boolean IGNORE_MALFORMED = false; + public static final Explicit IGNORE_MALFORMED = new Explicit(false, false); } public abstract static class Builder extends AbstractFieldMapper.Builder { @@ -104,12 +105,12 @@ public abstract class NumberFieldMapper extends AbstractFieldM return builder; } - protected boolean ignoreMalformed(BuilderContext context) { + protected Explicit ignoreMalformed(BuilderContext context) { if (ignoreMalformed != null) { - return ignoreMalformed; + return new Explicit(ignoreMalformed, true); } if (context.indexSettings() != null) { - return context.indexSettings().getAsBoolean("index.mapping.ignore_malformed", Defaults.IGNORE_MALFORMED); + return new Explicit(context.indexSettings().getAsBoolean("index.mapping.ignore_malformed", Defaults.IGNORE_MALFORMED.value()), false); } return Defaults.IGNORE_MALFORMED; } @@ -123,7 +124,7 @@ public abstract class NumberFieldMapper extends AbstractFieldM protected Boolean includeInAll; - protected boolean ignoreMalformed; + protected Explicit ignoreMalformed; private ThreadLocal tokenStream = new ThreadLocal() { @Override @@ -135,7 +136,7 @@ public abstract class NumberFieldMapper extends AbstractFieldM protected NumberFieldMapper(Names names, int precisionStep, @Nullable String fuzzyFactor, Field.Index index, Field.Store store, float boost, boolean omitNorms, IndexOptions indexOptions, - boolean ignoreMalformed, NamedAnalyzer indexAnalyzer, NamedAnalyzer searchAnalyzer) { + Explicit ignoreMalformed, NamedAnalyzer indexAnalyzer, NamedAnalyzer searchAnalyzer) { super(names, index, store, Field.TermVector.NO, boost, boost != 1.0f || omitNorms, indexOptions, indexAnalyzer, searchAnalyzer); if (precisionStep <= 0 || precisionStep >= maxPrecisionStep()) { this.precisionStep = Integer.MAX_VALUE; @@ -185,7 +186,7 @@ public abstract class NumberFieldMapper extends AbstractFieldM e = e2; } - if (ignoreMalformed) { + if (ignoreMalformed.value()) { return null; } else { throw e; @@ -263,7 +264,9 @@ public abstract class NumberFieldMapper extends AbstractFieldM this.includeInAll = nfmMergeWith.includeInAll; this.fuzzyFactor = nfmMergeWith.fuzzyFactor; this.dFuzzyFactor = parseFuzzyFactor(nfmMergeWith.fuzzyFactor); - this.ignoreMalformed = nfmMergeWith.ignoreMalformed; + if (nfmMergeWith.ignoreMalformed.explicit()) { + this.ignoreMalformed = nfmMergeWith.ignoreMalformed; + } } } @@ -320,6 +323,8 @@ public abstract class NumberFieldMapper extends AbstractFieldM @Override protected void doXContentBody(XContentBuilder builder) throws IOException { super.doXContentBody(builder); - builder.field("ignore_malformed", ignoreMalformed); + if (ignoreMalformed.explicit()) { + builder.field("ignore_malformed", ignoreMalformed.value()); + } } } diff --git a/src/main/java/org/elasticsearch/index/mapper/core/ShortFieldMapper.java b/src/main/java/org/elasticsearch/index/mapper/core/ShortFieldMapper.java index bc7fac751c3..237b8b08d25 100644 --- a/src/main/java/org/elasticsearch/index/mapper/core/ShortFieldMapper.java +++ b/src/main/java/org/elasticsearch/index/mapper/core/ShortFieldMapper.java @@ -28,6 +28,7 @@ import org.apache.lucene.search.NumericRangeFilter; import org.apache.lucene.search.NumericRangeQuery; import org.apache.lucene.search.Query; import org.apache.lucene.util.NumericUtils; +import org.elasticsearch.common.Explicit; import org.elasticsearch.common.Nullable; import org.elasticsearch.common.Numbers; import org.elasticsearch.common.Strings; @@ -38,7 +39,6 @@ import org.elasticsearch.index.analysis.NumericIntegerAnalyzer; import org.elasticsearch.index.cache.field.data.FieldDataCache; import org.elasticsearch.index.field.data.FieldDataType; import org.elasticsearch.index.mapper.*; -import org.elasticsearch.index.mapper.core.BooleanFieldMapper.Defaults; import org.elasticsearch.index.query.QueryParseContext; import org.elasticsearch.index.search.NumericRangeFieldDataFilter; @@ -106,7 +106,7 @@ public class ShortFieldMapper extends NumberFieldMapper { protected ShortFieldMapper(Names names, int precisionStep, String fuzzyFactor, Field.Index index, Field.Store store, float boost, boolean omitNorms, IndexOptions indexOptions, - Short nullValue, boolean ignoreMalformed) { + Short nullValue, Explicit ignoreMalformed) { super(names, precisionStep, fuzzyFactor, index, store, boost, omitNorms, indexOptions, ignoreMalformed, new NamedAnalyzer("_short/" + precisionStep, new NumericIntegerAnalyzer(precisionStep)), new NamedAnalyzer("_short/max", new NumericIntegerAnalyzer(Integer.MAX_VALUE))); diff --git a/src/main/java/org/elasticsearch/index/mapper/internal/BoostFieldMapper.java b/src/main/java/org/elasticsearch/index/mapper/internal/BoostFieldMapper.java index fb3a91048e0..97ef611857f 100644 --- a/src/main/java/org/elasticsearch/index/mapper/internal/BoostFieldMapper.java +++ b/src/main/java/org/elasticsearch/index/mapper/internal/BoostFieldMapper.java @@ -118,7 +118,7 @@ public class BoostFieldMapper extends NumberFieldMapper implements Intern float boost, boolean omitNorms, IndexOptions indexOptions, Float nullValue) { super(new Names(name, indexName, indexName, name), precisionStep, null, index, store, boost, omitNorms, indexOptions, - false, new NamedAnalyzer("_float/" + precisionStep, new NumericFloatAnalyzer(precisionStep)), + Defaults.IGNORE_MALFORMED, new NamedAnalyzer("_float/" + precisionStep, new NumericFloatAnalyzer(precisionStep)), new NamedAnalyzer("_float/max", new NumericFloatAnalyzer(Integer.MAX_VALUE))); this.nullValue = nullValue; } diff --git a/src/main/java/org/elasticsearch/index/mapper/internal/TTLFieldMapper.java b/src/main/java/org/elasticsearch/index/mapper/internal/TTLFieldMapper.java index 6f3468ea147..86bdc43775f 100644 --- a/src/main/java/org/elasticsearch/index/mapper/internal/TTLFieldMapper.java +++ b/src/main/java/org/elasticsearch/index/mapper/internal/TTLFieldMapper.java @@ -21,6 +21,7 @@ package org.elasticsearch.index.mapper.internal; import org.apache.lucene.document.Field; import org.apache.lucene.document.Fieldable; +import org.elasticsearch.common.Explicit; import org.elasticsearch.common.Strings; import org.elasticsearch.common.unit.TimeValue; import org.elasticsearch.common.xcontent.XContentBuilder; @@ -107,7 +108,7 @@ public class TTLFieldMapper extends LongFieldMapper implements InternalMapper, R this(Defaults.STORE, Defaults.INDEX, Defaults.ENABLED, Defaults.DEFAULT, Defaults.IGNORE_MALFORMED); } - protected TTLFieldMapper(Field.Store store, Field.Index index, boolean enabled, long defaultTTL, boolean ignoreMalformed) { + protected TTLFieldMapper(Field.Store store, Field.Index index, boolean enabled, long defaultTTL, Explicit ignoreMalformed) { super(new Names(Defaults.NAME, Defaults.NAME, Defaults.NAME, Defaults.NAME), Defaults.PRECISION_STEP, Defaults.FUZZY_FACTOR, index, store, Defaults.BOOST, Defaults.OMIT_NORMS, Defaults.INDEX_OPTIONS, Defaults.NULL_VALUE, ignoreMalformed); diff --git a/src/main/java/org/elasticsearch/index/mapper/internal/TimestampFieldMapper.java b/src/main/java/org/elasticsearch/index/mapper/internal/TimestampFieldMapper.java index 1ba1ac7f5e9..9c6ce847168 100644 --- a/src/main/java/org/elasticsearch/index/mapper/internal/TimestampFieldMapper.java +++ b/src/main/java/org/elasticsearch/index/mapper/internal/TimestampFieldMapper.java @@ -21,6 +21,7 @@ package org.elasticsearch.index.mapper.internal; import org.apache.lucene.document.Field; import org.apache.lucene.document.Fieldable; +import org.elasticsearch.common.Explicit; import org.elasticsearch.common.Strings; import org.elasticsearch.common.joda.FormatDateTimeFormatter; import org.elasticsearch.common.joda.Joda; @@ -123,7 +124,7 @@ public class TimestampFieldMapper extends DateFieldMapper implements InternalMap } protected TimestampFieldMapper(Field.Store store, Field.Index index, boolean enabled, String path, - FormatDateTimeFormatter dateTimeFormatter, boolean parseUpperInclusive, boolean ignoreMalformed) { + FormatDateTimeFormatter dateTimeFormatter, boolean parseUpperInclusive, Explicit ignoreMalformed) { super(new Names(Defaults.NAME, Defaults.NAME, Defaults.NAME, Defaults.NAME), dateTimeFormatter, Defaults.PRECISION_STEP, Defaults.FUZZY_FACTOR, index, store, Defaults.BOOST, Defaults.OMIT_NORMS, Defaults.INDEX_OPTIONS, Defaults.NULL_VALUE, TimeUnit.MILLISECONDS /*always milliseconds*/, diff --git a/src/main/java/org/elasticsearch/index/mapper/ip/IpFieldMapper.java b/src/main/java/org/elasticsearch/index/mapper/ip/IpFieldMapper.java index 0500cb6a4e7..5cf1ebdacc4 100644 --- a/src/main/java/org/elasticsearch/index/mapper/ip/IpFieldMapper.java +++ b/src/main/java/org/elasticsearch/index/mapper/ip/IpFieldMapper.java @@ -26,6 +26,7 @@ import org.apache.lucene.index.FieldInfo.IndexOptions; import org.apache.lucene.search.*; import org.apache.lucene.util.NumericUtils; import org.elasticsearch.ElasticSearchIllegalArgumentException; +import org.elasticsearch.common.Explicit; import org.elasticsearch.common.Nullable; import org.elasticsearch.common.Numbers; import org.elasticsearch.common.Strings; @@ -39,7 +40,6 @@ import org.elasticsearch.index.field.data.FieldDataType; import org.elasticsearch.index.mapper.*; import org.elasticsearch.index.mapper.core.LongFieldMapper; import org.elasticsearch.index.mapper.core.NumberFieldMapper; -import org.elasticsearch.index.mapper.core.BooleanFieldMapper.Defaults; import org.elasticsearch.index.query.QueryParseContext; import org.elasticsearch.index.search.NumericRangeFieldDataFilter; @@ -132,7 +132,7 @@ public class IpFieldMapper extends NumberFieldMapper { protected IpFieldMapper(Names names, int precisionStep, Field.Index index, Field.Store store, float boost, boolean omitNorms, IndexOptions indexOptions, - String nullValue, boolean ignoreMalformed) { + String nullValue, Explicit ignoreMalformed) { super(names, precisionStep, null, index, store, boost, omitNorms, indexOptions, ignoreMalformed, new NamedAnalyzer("_ip/" + precisionStep, new NumericIpAnalyzer(precisionStep)), new NamedAnalyzer("_ip/max", new NumericIpAnalyzer(Integer.MAX_VALUE)));