You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by jp...@apache.org on 2021/05/14 12:04:13 UTC

[lucene-solr] branch branch_8x updated: LUCENE-9958: Fixed performance regression for boolean queries that configure a minimum number of matching clauses.

This is an automated email from the ASF dual-hosted git repository.

jpountz pushed a commit to branch branch_8x
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git


The following commit(s) were added to refs/heads/branch_8x by this push:
     new d50d5de  LUCENE-9958: Fixed performance regression for boolean queries that configure a minimum number of matching clauses.
d50d5de is described below

commit d50d5dec62b612b8d603d82d33044cfc97c02d91
Author: Adrien Grand <jp...@gmail.com>
AuthorDate: Fri May 14 14:01:11 2021 +0200

    LUCENE-9958: Fixed performance regression for boolean queries that configure a minimum number of matching clauses.
---
 lucene/CHANGES.txt                                            | 3 +++
 lucene/core/src/java/org/apache/lucene/search/WANDScorer.java | 2 +-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/lucene/CHANGES.txt b/lucene/CHANGES.txt
index ac78502..35a794b 100644
--- a/lucene/CHANGES.txt
+++ b/lucene/CHANGES.txt
@@ -73,6 +73,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
 ---------------------
 
diff --git a/lucene/core/src/java/org/apache/lucene/search/WANDScorer.java b/lucene/core/src/java/org/apache/lucene/search/WANDScorer.java
index 2d31bbf..48e071f8 100644
--- a/lucene/core/src/java/org/apache/lucene/search/WANDScorer.java
+++ b/lucene/core/src/java/org/apache/lucene/search/WANDScorer.java
@@ -543,7 +543,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;