LUCENE-10608: Ignore conjunctions that have a non-zero minShouldMatch from the count logic.

This commit is contained in:
Adrien Grand 2022-06-15 10:13:22 +02:00
parent 7bbc1bf28d
commit d52122605d
1 changed files with 3 additions and 0 deletions

View File

@ -362,6 +362,9 @@ final class BooleanWeight extends Weight {
return super.count(context);
}
}
if (query.getMinimumNumberShouldMatch() > 0) {
return super.count(context);
}
// From now on we know the query is a pure conjunction
final int numDocs = context.reader().numDocs();
int conjunctionCount = numDocs;