You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by GitBox <gi...@apache.org> on 2021/04/14 05:58:58 UTC

[GitHub] [lucene] zacharymorn commented on a change in pull request #81: LUCENE-9335: [WIP] Speed up pure disjunction with BMM

zacharymorn commented on a change in pull request #81:
URL: https://github.com/apache/lucene/pull/81#discussion_r612957244



##########
File path: lucene/core/src/java/org/apache/lucene/search/DisjunctionSumScorer.java
##########
@@ -45,8 +47,18 @@ protected float score(DisiWrapper topList) throws IOException {
 
   @Override
   public float getMaxScore(int upTo) throws IOException {
-    // It's ok to return a bad upper bound here since we use WANDScorer when
-    // we actually care about block scores.
-    return Float.MAX_VALUE;
+    double sum = 0;
+    for (Scorer scorer : subScorers) {
+      sum += scorer.getMaxScore(upTo);
+    }
+    return (float) sum;
+  }
+
+  @Override
+  public void setMinCompetitiveScore(float minScore) throws IOException {
+    super.setMinCompetitiveScore(minScore);
+    for (Scorer scorer : subScorers) {
+      scorer.setMinCompetitiveScore(minScore);
+    }

Review comment:
       Yes sorry about this bug. I went through the code a bit more and realized there were other issues as well. I have reverted the changes to `DisjunctionMaxScorer` and `DisjunctionScorer`, and updated code in `DisjunctionSumScorer` to use `MaxScoreSumPropagator` instead for block max related logic. 




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org