diff --git a/src/main/java/org/elasticsearch/index/mapper/core/TypeParsers.java b/src/main/java/org/elasticsearch/index/mapper/core/TypeParsers.java index 0c77e836468..7119e4ff630 100644 --- a/src/main/java/org/elasticsearch/index/mapper/core/TypeParsers.java +++ b/src/main/java/org/elasticsearch/index/mapper/core/TypeParsers.java @@ -68,6 +68,13 @@ public class TypeParsers { builder.omitNorms(nodeBooleanValue(propNode)); } else if (propName.equals("omit_term_freq_and_positions")) { builder.omitTermFreqAndPositions(nodeBooleanValue(propNode)); + } else if (propName.equals("analyzer")) { + NamedAnalyzer analyzer = parserContext.analysisService().analyzer(propNode.toString()); + if (analyzer == null) { + throw new MapperParsingException("Analyzer [" + propNode.toString() + "] not found for field [" + name + "]"); + } + builder.indexAnalyzer(analyzer); + builder.searchAnalyzer(analyzer); } else if (propName.equals("index_analyzer")) { NamedAnalyzer analyzer = parserContext.analysisService().analyzer(propNode.toString()); if (analyzer == null) { @@ -80,13 +87,6 @@ public class TypeParsers { throw new MapperParsingException("Analyzer [" + propNode.toString() + "] not found for field [" + name + "]"); } builder.searchAnalyzer(analyzer); - } else if (propName.equals("analyzer")) { - NamedAnalyzer analyzer = parserContext.analysisService().analyzer(propNode.toString()); - if (analyzer == null) { - throw new MapperParsingException("Analyzer [" + propNode.toString() + "] not found for field [" + name + "]"); - } - builder.indexAnalyzer(analyzer); - builder.searchAnalyzer(analyzer); } else if (propName.equals("include_in_all")) { builder.includeInAll(nodeBooleanValue(propNode)); }