Merge pull request #15664 from jpountz/remove/ParseContext_ignoredValue

Remove ParseContext.ignoredValue.
This commit is contained in:
Adrien Grand 2015-12-28 12:05:26 +01:00
commit baaeb0f578
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 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<String, String> 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.
*/

View File

@ -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());
}
}
/**

View File

@ -147,9 +147,6 @@ public class TokenCountFieldMapper extends IntegerFieldMapper {
}
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) {
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()));
}
}
}

View File

@ -312,9 +312,6 @@ public class TimestampFieldMapper extends MetadataFieldMapper {
protected void parseCreateField(ParseContext context, List<Field> 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()));
}