LUCENE-9958: Fixed performance regression for boolean queries that configure a minimum number of matching clauses.

This commit is contained in:
Adrien Grand 2021-05-14 13:55:12 +02:00
parent 8e94a591d8
commit 2c04ab5835
2 changed files with 4 additions and 1 deletions

View File

@ -383,6 +383,9 @@ Bug Fixes
* LUCENE-9887: Fixed parameter use in RadixSelector.
(liupanfeng via Adrien Grand)
* LUCENE-9958: Fixed performance regression for boolean queries that configure a
minimum number of matching clauses. (Adrien Grand, Matt Weber)
Other
---------------------

View File

@ -548,7 +548,7 @@ final class WANDScorer extends Scorer {
/** Insert an entry in 'tail' and evict the least-costly scorer if full. */
private DisiWrapper insertTailWithOverFlow(DisiWrapper s) {
if (tailMaxScore + s.maxScore < minCompetitiveScore) {
if (tailMaxScore + s.maxScore < minCompetitiveScore || tailSize + 1 < minShouldMatch) {
// we have free room for this new entry
addTail(s);
tailMaxScore += s.maxScore;