Make indexQueryParserService available. Closes #8248
This commit is contained in:
parent
f9b5906871
commit
1d95630a35
|
@ -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();
|
||||
|
||||
|
@ -137,6 +137,10 @@ public class QueryParseContext {
|
|||
return parser;
|
||||
}
|
||||
|
||||
public IndexQueryParserService indexQueryParserService() {
|
||||
return indexQueryParser;
|
||||
}
|
||||
|
||||
public AnalysisService analysisService() {
|
||||
return indexQueryParser.analysisService;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue