Make indexQueryParserService available. Closes #8248

This commit is contained in:
Uwe Schindler 2014-10-28 12:30:36 +01:00
parent f9b5906871
commit 1d95630a35
4 changed files with 8 additions and 4 deletions

View File

@ -82,7 +82,7 @@ public class QueryParseContext {
private boolean requireCustomQueryWrappingFilter = false;
final IndexQueryParserService indexQueryParser;
private final IndexQueryParserService indexQueryParser;
private final Map<String, Filter> namedFilters = Maps.newHashMap();
@ -136,6 +136,10 @@ public class QueryParseContext {
public XContentParser parser() {
return parser;
}
public IndexQueryParserService indexQueryParserService() {
return indexQueryParser;
}
public AnalysisService analysisService() {
return indexQueryParser.analysisService;

View File

@ -83,7 +83,7 @@ public class TemplateQueryParser implements QueryParser {
BytesReference querySource = (BytesReference) executable.run();
try (XContentParser qSourceParser = XContentFactory.xContent(querySource).createParser(querySource)) {
final QueryParseContext context = new QueryParseContext(parseContext.index(), parseContext.indexQueryParser);
final QueryParseContext context = new QueryParseContext(parseContext.index(), parseContext.indexQueryParserService());
context.reset(qSourceParser);
Query result = context.parseInnerQuery();
return result;

View File

@ -58,7 +58,7 @@ public class WrapperFilterParser implements FilterParser {
byte[] querySource = parser.binaryValue();
try (XContentParser qSourceParser = XContentFactory.xContent(querySource).createParser(querySource)) {
final QueryParseContext context = new QueryParseContext(parseContext.index(), parseContext.indexQueryParser);
final QueryParseContext context = new QueryParseContext(parseContext.index(), parseContext.indexQueryParserService());
context.reset(qSourceParser);
Filter result = context.parseInnerFilter();
parser.nextToken();

View File

@ -58,7 +58,7 @@ public class WrapperQueryParser implements QueryParser {
byte[] querySource = parser.binaryValue();
try (XContentParser qSourceParser = XContentFactory.xContent(querySource).createParser(querySource)) {
final QueryParseContext context = new QueryParseContext(parseContext.index(), parseContext.indexQueryParser);
final QueryParseContext context = new QueryParseContext(parseContext.index(), parseContext.indexQueryParserService());
context.reset(qSourceParser);
Query result = context.parseInnerQuery();
parser.nextToken();