diff --git a/core/src/main/java/org/elasticsearch/index/query/IndexQueryParserService.java b/core/src/main/java/org/elasticsearch/index/query/IndexQueryParserService.java index 5be406e5bab..76a1577b2a4 100644 --- a/core/src/main/java/org/elasticsearch/index/query/IndexQueryParserService.java +++ b/core/src/main/java/org/elasticsearch/index/query/IndexQueryParserService.java @@ -153,27 +153,6 @@ public class IndexQueryParserService extends AbstractIndexComponent { return indicesQueriesRegistry; } - public ParsedQuery parse(QueryBuilder queryBuilder) { - QueryShardContext context = cache.get(); - context.reset(); - context.parseFieldMatcher(parseFieldMatcher); - try { - return innerParse(context, queryBuilder); - } catch (ParsingException e) { - throw e; - } catch (Exception e) { - throw new QueryShardException(context, "failed to create query: {}", e, queryBuilder); - } - } - - private static ParsedQuery innerParse(QueryShardContext context, QueryBuilder queryBuilder) throws IOException, QueryShardException { - Query query = queryBuilder.toQuery(context); - if (query == null) { - query = Queries.newMatchNoDocsQuery(); - } - return new ParsedQuery(query, context.copyNamedQueries()); - } - public ParsedQuery parse(BytesReference source) { QueryShardContext context = cache.get(); XContentParser parser = null; @@ -279,7 +258,7 @@ public class IndexQueryParserService extends AbstractIndexComponent { public Query parseInnerQuery(QueryShardContext context) throws IOException { return toQuery(context.parseContext().parseInnerQueryBuilder(), context); - } + } public ParsedQuery toQuery(QueryBuilder queryBuilder) { QueryShardContext context = cache.get();