diff --git a/core/src/main/java/org/elasticsearch/index/mapper/ParseContext.java b/core/src/main/java/org/elasticsearch/index/mapper/ParseContext.java index 0a88e29c8d6..3c12f51a7f7 100644 --- a/core/src/main/java/org/elasticsearch/index/mapper/ParseContext.java +++ b/core/src/main/java/org/elasticsearch/index/mapper/ParseContext.java @@ -34,10 +34,8 @@ import org.elasticsearch.index.analysis.AnalysisService; import org.elasticsearch.index.mapper.object.RootObjectMapper; import java.util.ArrayList; -import java.util.HashMap; import java.util.Iterator; import java.util.List; -import java.util.Map; /** * @@ -288,16 +286,6 @@ public abstract class ParseContext { return in.id(); } - @Override - public void ignoredValue(String indexName, String value) { - in.ignoredValue(indexName, value); - } - - @Override - public String ignoredValue(String indexName) { - return in.ignoredValue(indexName); - } - @Override public void id(String id) { in.id(id); @@ -390,8 +378,6 @@ public abstract class ParseContext { private StringBuilder stringBuilder = new StringBuilder(); - private Map ignoredValues = new HashMap<>(); - private AllEntries allEntries = new AllEntries(); private float docBoost = 1.0f; @@ -421,7 +407,6 @@ public abstract class ParseContext { this.source = source == null ? null : sourceToParse.source(); this.path.reset(); this.allEntries = new AllEntries(); - this.ignoredValues.clear(); this.docBoost = 1.0f; this.dynamicMappingsUpdate = null; } @@ -523,16 +508,6 @@ public abstract class ParseContext { return id; } - @Override - public void ignoredValue(String indexName, String value) { - ignoredValues.put(indexName, value); - } - - @Override - public String ignoredValue(String indexName) { - return ignoredValues.get(indexName); - } - /** * Really, just the id mapper should set this. */ @@ -710,10 +685,6 @@ public abstract class ParseContext { public abstract String id(); - public abstract void ignoredValue(String indexName, String value); - - public abstract String ignoredValue(String indexName); - /** * Really, just the id mapper should set this. */ diff --git a/core/src/main/java/org/elasticsearch/index/mapper/core/StringFieldMapper.java b/core/src/main/java/org/elasticsearch/index/mapper/core/StringFieldMapper.java index f8f9cb25ba1..3885690c7ec 100644 --- a/core/src/main/java/org/elasticsearch/index/mapper/core/StringFieldMapper.java +++ b/core/src/main/java/org/elasticsearch/index/mapper/core/StringFieldMapper.java @@ -326,9 +326,6 @@ public class StringFieldMapper extends FieldMapper implements AllFieldMapper.Inc if (fieldType().hasDocValues()) { fields.add(new SortedSetDocValuesField(fieldType().name(), new BytesRef(valueAndBoost.value()))); } - if (fields.isEmpty()) { - context.ignoredValue(fieldType().name(), valueAndBoost.value()); - } } /** diff --git a/core/src/main/java/org/elasticsearch/index/mapper/core/TokenCountFieldMapper.java b/core/src/main/java/org/elasticsearch/index/mapper/core/TokenCountFieldMapper.java index 1fd1debe60c..85df5ea3d3b 100644 --- a/core/src/main/java/org/elasticsearch/index/mapper/core/TokenCountFieldMapper.java +++ b/core/src/main/java/org/elasticsearch/index/mapper/core/TokenCountFieldMapper.java @@ -147,9 +147,6 @@ public class TokenCountFieldMapper extends IntegerFieldMapper { } addIntegerFields(context, fields, count, valueAndBoost.boost()); } - if (fields.isEmpty()) { - context.ignoredValue(fieldType().name(), valueAndBoost.value()); - } } /** diff --git a/core/src/main/java/org/elasticsearch/index/mapper/internal/RoutingFieldMapper.java b/core/src/main/java/org/elasticsearch/index/mapper/internal/RoutingFieldMapper.java index 4fb410dbdc8..5fd1d2f49a3 100644 --- a/core/src/main/java/org/elasticsearch/index/mapper/internal/RoutingFieldMapper.java +++ b/core/src/main/java/org/elasticsearch/index/mapper/internal/RoutingFieldMapper.java @@ -205,11 +205,9 @@ public class RoutingFieldMapper extends MetadataFieldMapper { if (context.sourceToParse().routing() != null) { String routing = context.sourceToParse().routing(); if (routing != null) { - if (fieldType().indexOptions() == IndexOptions.NONE && !fieldType().stored()) { - context.ignoredValue(fieldType().name(), routing); - return; + if (fieldType().indexOptions() != IndexOptions.NONE || fieldType().stored()) { + fields.add(new Field(fieldType().name(), routing, fieldType())); } - fields.add(new Field(fieldType().name(), routing, fieldType())); } } } diff --git a/core/src/main/java/org/elasticsearch/index/mapper/internal/TimestampFieldMapper.java b/core/src/main/java/org/elasticsearch/index/mapper/internal/TimestampFieldMapper.java index 3771747bf66..e8a37a49e3e 100644 --- a/core/src/main/java/org/elasticsearch/index/mapper/internal/TimestampFieldMapper.java +++ b/core/src/main/java/org/elasticsearch/index/mapper/internal/TimestampFieldMapper.java @@ -312,9 +312,6 @@ public class TimestampFieldMapper extends MetadataFieldMapper { protected void parseCreateField(ParseContext context, List fields) throws IOException { if (enabledState.enabled) { long timestamp = context.sourceToParse().timestamp(); - if (fieldType().indexOptions() == IndexOptions.NONE && !fieldType().stored() && !fieldType().hasDocValues()) { - context.ignoredValue(fieldType().name(), String.valueOf(timestamp)); - } if (fieldType().indexOptions() != IndexOptions.NONE || fieldType().stored()) { fields.add(new LongFieldMapper.CustomLongNumericField(timestamp, fieldType())); }