diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/index/query/xcontent/FieldQueryParser.java b/modules/elasticsearch/src/main/java/org/elasticsearch/index/query/xcontent/FieldQueryParser.java index 13d3760f699..c6656fab326 100644 --- a/modules/elasticsearch/src/main/java/org/elasticsearch/index/query/xcontent/FieldQueryParser.java +++ b/modules/elasticsearch/src/main/java/org/elasticsearch/index/query/xcontent/FieldQueryParser.java @@ -131,7 +131,7 @@ public class FieldQueryParser extends AbstractIndexComponent implements XContent return query; } - MapperQueryParser queryParser = parseContext.queryParser(qpSettings); + MapperQueryParser queryParser = parseContext.singleQueryParser(qpSettings); try { query = queryParser.parse(qpSettings.queryString()); diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/index/query/xcontent/QueryParseContext.java b/modules/elasticsearch/src/main/java/org/elasticsearch/index/query/xcontent/QueryParseContext.java index b0ff9381afb..e7a8036282d 100644 --- a/modules/elasticsearch/src/main/java/org/elasticsearch/index/query/xcontent/QueryParseContext.java +++ b/modules/elasticsearch/src/main/java/org/elasticsearch/index/query/xcontent/QueryParseContext.java @@ -104,12 +104,12 @@ public class QueryParseContext { return indexQueryParser.indexCache; } - public MapperQueryParser queryParser(QueryParserSettings settings) { + public MapperQueryParser singleQueryParser(QueryParserSettings settings) { queryParser.reset(settings); return queryParser; } - public MultiFieldMapperQueryParser queryParser(MultiFieldQueryParserSettings settings) { + public MultiFieldMapperQueryParser multiQueryParser(MultiFieldQueryParserSettings settings) { multiFieldQueryParser.reset(settings); return multiFieldQueryParser; } diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/index/query/xcontent/QueryStringQueryParser.java b/modules/elasticsearch/src/main/java/org/elasticsearch/index/query/xcontent/QueryStringQueryParser.java index 595201afb31..73e8dca8ac2 100644 --- a/modules/elasticsearch/src/main/java/org/elasticsearch/index/query/xcontent/QueryStringQueryParser.java +++ b/modules/elasticsearch/src/main/java/org/elasticsearch/index/query/xcontent/QueryStringQueryParser.java @@ -177,13 +177,13 @@ public class QueryStringQueryParser extends AbstractIndexComponent implements XC if (qpSettings.fields() != null) { if (qpSettings.fields().size() == 1) { qpSettings.defaultField(qpSettings.fields().get(0)); - queryParser = parseContext.queryParser(qpSettings); + queryParser = parseContext.singleQueryParser(qpSettings); } else { qpSettings.defaultField(null); // reset defaultField when using multi query parser - queryParser = parseContext.queryParser(qpSettings); + queryParser = parseContext.multiQueryParser(qpSettings); } } else { - queryParser = parseContext.queryParser(qpSettings); + queryParser = parseContext.singleQueryParser(qpSettings); }