Skip to content

Commit bc28873

Browse files
committed
convert to optimized match all query also when executing "*" query
1 parent 341c53b commit bc28873

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/main/java/org/apache/lucene/queryParser/MapperQueryParser.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -547,8 +547,11 @@ private Query getPossiblyAnalyzedPrefixQuery(String field, String termStr) throw
547547

548548
@Override
549549
protected Query getWildcardQuery(String field, String termStr) throws ParseException {
550-
if ("*".equals(field) && termStr.equals("*")) {
551-
return newMatchAllDocsQuery();
550+
if (termStr.equals("*")) {
551+
// we want to optimize for match all query for the "*:*", and "*" cases
552+
if ("*".equals(field) || field.equals(this.field)) {
553+
return newMatchAllDocsQuery();
554+
}
552555
}
553556
Collection<String> fields = extractMultiFields(field);
554557
if (fields != null) {

0 commit comments

Comments
 (0)