gsmiller commented on code in PR #13697:
URL: https://github.com/apache/lucene/pull/13697#discussion_r1754481819


##########
lucene/join/src/java/org/apache/lucene/search/join/ToParentBlockJoinQuery.java:
##########
@@ -348,34 +410,23 @@ public void setMinCompetitiveScore(float minScore) throws 
IOException {
       }
     }
 
-    private void setScoreAndFreq() throws IOException {
+    private float scoreChildDocs() throws IOException {
       if (childApproximation.docID() >= parentApproximation.docID()) {
-        return;
+        return parentScore.score();
       }
-      double score = scoreMode == ScoreMode.None ? 0 : childScorer.score();
-      int freq = 1;
-      while (childApproximation.nextDoc() < parentApproximation.docID()) {
-        if (childTwoPhase == null || childTwoPhase.matches()) {
-          final float childScore = scoreMode == ScoreMode.None ? 0 : 
childScorer.score();
-          freq += 1;
-          switch (scoreMode) {
-            case Total:
-            case Avg:
-              score += childScore;
-              break;
-            case Min:
-              score = Math.min(score, childScore);
-              break;
-            case Max:
-              score = Math.max(score, childScore);
-              break;
-            case None:
-              break;
-            default:
-              throw new AssertionError();
+
+      float score = 0;
+      if (scoreMode != ScoreMode.None) {

Review Comment:
   Thanks @Mikep86 & @jpountz!



-- 
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.

To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org

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


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

Reply via email to