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 2022/06/15 08:21:16 UTC

[lucene] branch branch_9x updated: LUCENE-10608: Ignore conjunctions that have a non-zero minShouldMatch from the count logic.

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

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


The following commit(s) were added to refs/heads/branch_9x by this push:
     new 807ea153dde LUCENE-10608: Ignore conjunctions that have a non-zero minShouldMatch from the count logic.
807ea153dde is described below

commit 807ea153dde64fa51ff22eadefc5ba93f6583540
Author: Adrien Grand <jp...@gmail.com>
AuthorDate: Wed Jun 15 10:13:22 2022 +0200

    LUCENE-10608: Ignore conjunctions that have a non-zero minShouldMatch from the count logic.
---
 lucene/core/src/java/org/apache/lucene/search/BooleanWeight.java | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/lucene/core/src/java/org/apache/lucene/search/BooleanWeight.java b/lucene/core/src/java/org/apache/lucene/search/BooleanWeight.java
index d8bbe09e34d..23cd81675c8 100644
--- a/lucene/core/src/java/org/apache/lucene/search/BooleanWeight.java
+++ b/lucene/core/src/java/org/apache/lucene/search/BooleanWeight.java
@@ -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;