"index_analyzer" and "search_analyzer" should override "analyzer", closes #2052.

This commit is contained in:
Shay Banon 2012-06-25 22:05:34 +02:00
parent 11ca3ea0ec
commit c39a27a328
1 changed files with 7 additions and 7 deletions

View File

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