zacharymorn commented on code in PR #1006:
URL: https://github.com/apache/lucene/pull/1006#discussion_r915373539
##########
lucene/core/src/java/org/apache/lucene/search/BlockMaxMaxscoreScorer.java:
##########
@@ -251,8 +230,31 @@ public long cost() {
@Override
public boolean matches() throws IOException {
- // Only sum up scores of non-essential scorers, essential scores were
already folded into
- // the score.
+ // Start evaluating the score of the new document. It initially only
includes essential
+ // clauses and abort / return early if a match is not possible.
+ // Scores of non-essential clauses get added later on to determine
actual matches.
+ DisiWrapper top = essentialsScorers.top();
+
+ score = 0;
+ for (DisiWrapper w = essentialsScorers.topList(); w != null; w =
w.next) {
+ score += w.scorer.score();
+ }
+
+ final double docScoreUpperBound = score + nonEssentialMaxScoreSum;
+
+ if (maxScoreSumPropagator.scoreSumUpperBound(docScoreUpperBound) <
minCompetitiveScore) {
+ // This doc is not competitive enough.
+ // Skip straight to next candidate doc from essential scorer
+ int docId = top.doc;
+ do {
+ top.doc = top.iterator.nextDoc();
+ top = essentialsScorers.updateTop();
+ } while (top.doc == docId);
Review Comment:
Yup good catch! I've removed it.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]