if (tokenizerName != null) {
Settings customTokenizerSettings = getCustomTokenizer(tokenizerName);
if (customTokenizerSettings != null) {
builder.put(customTokenizerSettings);
} else if (!hasBuiltInTokenizer(tokenizerName)) {
throw new AnalyzerInvalidException(String.format("Invalid Analyzer: could not resolve tokenizer '%s'", tokenizerName));
}
}
String[] tokenFilterNames = analyzerSettings.getAsArray(String.format("index.analysis.analyzer.%s.filter", name));
for (int i=0; i<tokenFilterNames.length; i++) {
Settings customTokenFilterSettings = getCustomTokenFilter(tokenFilterNames[i]);
if (customTokenFilterSettings != null) {
builder.put(customTokenFilterSettings);
} else if (!hasBuiltInTokenFilter(tokenFilterNames[i])) {
throw new AnalyzerInvalidException(String.format("Invalid Analyzer: could not resolve token-filter '%s'", tokenFilterNames[i]));
}
}
String[] charFilterNames = analyzerSettings.getAsArray(String.format("index.analysis.analyzer.%s.char_filter", name));
for (int i=0; i<charFilterNames.length; i++) {
Settings customCharFilterSettings = getCustomCharFilter(charFilterNames[i]);
if (customCharFilterSettings != null) {
builder.put(customCharFilterSettings);
} else if (!hasBuiltInCharFilter(charFilterNames[i])) {
throw new AnalyzerInvalidException(String.format("Invalid Analyzer: could not resolve char-filter '%s'", charFilterNames[i]));
}
}
} else {
throw new AnalyzerUnknownException(name);
}