Fix a type check that is always false
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.
@@ -631,9 +631,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)
