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
1 changed files with 1 additions and 3 deletions

View File

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