Fix a type check that is always false (#27726)

DocumentParser: The checks for Text and Keyword were masked by the
earlier check for String, which they are child classes of. As String
field types are no longer supported, this check can be removed.
This commit is contained in:
Robin Neatherway 2018-03-28 09:20:20 +01:00 committed by Christoph Büscher
parent 36f8531bf4
commit ea8e3661d0

View File

@ -625,9 +625,7 @@ final class DocumentParser {
private static Mapper.Builder<?,?> createBuilderFromFieldType(final ParseContext context, MappedFieldType fieldType, String currentFieldName) { private static Mapper.Builder<?,?> createBuilderFromFieldType(final ParseContext context, MappedFieldType fieldType, String currentFieldName) {
Mapper.Builder builder = null; Mapper.Builder builder = null;
if (fieldType instanceof StringFieldType) { if (fieldType instanceof TextFieldType) {
builder = context.root().findTemplateBuilder(context, currentFieldName, "string", XContentFieldType.STRING);
} else if (fieldType instanceof TextFieldType) {
builder = context.root().findTemplateBuilder(context, currentFieldName, "text", XContentFieldType.STRING); builder = context.root().findTemplateBuilder(context, currentFieldName, "text", XContentFieldType.STRING);
if (builder == null) { if (builder == null) {
builder = new TextFieldMapper.Builder(currentFieldName) builder = new TextFieldMapper.Builder(currentFieldName)