if (namedQueryParsers != null) {
Map<String, Settings> queryParserGroups = indexSettings.getGroups(IndexQueryParserService.Defaults.QUERY_PREFIX);
for (Map.Entry<String, QueryParserFactory> entry : namedQueryParsers.entrySet()) {
String queryParserName = entry.getKey();
QueryParserFactory queryParserFactory = entry.getValue();
Settings queryParserSettings = queryParserGroups.get(queryParserName);
if (queryParserSettings == null) {
queryParserSettings = EMPTY_SETTINGS;
}
queryParsers.add(queryParserFactory.create(queryParserName, queryParserSettings));
}
}
Map<String, QueryParser> queryParsersMap = newHashMap();
queryParsersMap.putAll(indicesQueriesRegistry.queryParsers());
if (queryParsers != null) {
for (QueryParser queryParser : queryParsers) {
add(queryParsersMap, queryParser);
}
}
this.queryParsers = ImmutableMap.copyOf(queryParsersMap);
List<FilterParser> filterParsers = newArrayList();
if (namedFilterParsers != null) {
Map<String, Settings> filterParserGroups = indexSettings.getGroups(IndexQueryParserService.Defaults.FILTER_PREFIX);
for (Map.Entry<String, FilterParserFactory> entry : namedFilterParsers.entrySet()) {
String filterParserName = entry.getKey();
FilterParserFactory filterParserFactory = entry.getValue();
Settings filterParserSettings = filterParserGroups.get(filterParserName);
if (filterParserSettings == null) {
filterParserSettings = EMPTY_SETTINGS;
}
filterParsers.add(filterParserFactory.create(filterParserName, filterParserSettings));
}