Remove ParseContext.ignoredValue.

This API is unused.
This commit is contained in:
Adrien Grand 2015-12-24 15:28:09 +01:00
parent 485915bbe7
commit 23f736a0c1
5 changed files with 2 additions and 42 deletions

View File

@ -34,10 +34,8 @@ import org.elasticsearch.index.analysis.AnalysisService;
import org.elasticsearch.index.mapper.object.RootObjectMapper; import org.elasticsearch.index.mapper.object.RootObjectMapper;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator; import java.util.Iterator;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* *
@ -288,16 +286,6 @@ public abstract class ParseContext {
return in.id(); 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 @Override
public void id(String id) { public void id(String id) {
in.id(id); in.id(id);
@ -390,8 +378,6 @@ public abstract class ParseContext {
private StringBuilder stringBuilder = new StringBuilder(); private StringBuilder stringBuilder = new StringBuilder();
private Map<String, String> ignoredValues = new HashMap<>();
private AllEntries allEntries = new AllEntries(); private AllEntries allEntries = new AllEntries();
private float docBoost = 1.0f; private float docBoost = 1.0f;
@ -421,7 +407,6 @@ public abstract class ParseContext {
this.source = source == null ? null : sourceToParse.source(); this.source = source == null ? null : sourceToParse.source();
this.path.reset(); this.path.reset();
this.allEntries = new AllEntries(); this.allEntries = new AllEntries();
this.ignoredValues.clear();
this.docBoost = 1.0f; this.docBoost = 1.0f;
this.dynamicMappingsUpdate = null; this.dynamicMappingsUpdate = null;
} }
@ -523,16 +508,6 @@ public abstract class ParseContext {
return id; 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. * Really, just the id mapper should set this.
*/ */
@ -710,10 +685,6 @@ public abstract class ParseContext {
public abstract String id(); 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. * Really, just the id mapper should set this.
*/ */

View File

@ -326,9 +326,6 @@ public class StringFieldMapper extends FieldMapper implements AllFieldMapper.Inc
if (fieldType().hasDocValues()) { if (fieldType().hasDocValues()) {
fields.add(new SortedSetDocValuesField(fieldType().name(), new BytesRef(valueAndBoost.value()))); fields.add(new SortedSetDocValuesField(fieldType().name(), new BytesRef(valueAndBoost.value())));
} }
if (fields.isEmpty()) {
context.ignoredValue(fieldType().name(), valueAndBoost.value());
}
} }
/** /**

View File

@ -147,9 +147,6 @@ public class TokenCountFieldMapper extends IntegerFieldMapper {
} }
addIntegerFields(context, fields, count, valueAndBoost.boost()); addIntegerFields(context, fields, count, valueAndBoost.boost());
} }
if (fields.isEmpty()) {
context.ignoredValue(fieldType().name(), valueAndBoost.value());
}
} }
/** /**

View File

@ -205,11 +205,9 @@ public class RoutingFieldMapper extends MetadataFieldMapper {
if (context.sourceToParse().routing() != null) { if (context.sourceToParse().routing() != null) {
String routing = context.sourceToParse().routing(); String routing = context.sourceToParse().routing();
if (routing != null) { if (routing != null) {
if (fieldType().indexOptions() == IndexOptions.NONE && !fieldType().stored()) { if (fieldType().indexOptions() != IndexOptions.NONE || fieldType().stored()) {
context.ignoredValue(fieldType().name(), routing); fields.add(new Field(fieldType().name(), routing, fieldType()));
return;
} }
fields.add(new Field(fieldType().name(), routing, fieldType()));
} }
} }
} }

View File

@ -312,9 +312,6 @@ public class TimestampFieldMapper extends MetadataFieldMapper {
protected void parseCreateField(ParseContext context, List<Field> fields) throws IOException { protected void parseCreateField(ParseContext context, List<Field> fields) throws IOException {
if (enabledState.enabled) { if (enabledState.enabled) {
long timestamp = context.sourceToParse().timestamp(); 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()) { if (fieldType().indexOptions() != IndexOptions.NONE || fieldType().stored()) {
fields.add(new LongFieldMapper.CustomLongNumericField(timestamp, fieldType())); fields.add(new LongFieldMapper.CustomLongNumericField(timestamp, fieldType()));
} }