Skip to content

Commit

Permalink
SOLR-15114: WAND does not work correctly on multiple segments (apache…
Browse files Browse the repository at this point in the history
…#2259)

In Solr 8.6.3, minCompetitiveScore of WANDScorer resets to zero for each index segment and remain zero until maxScore is updated.
There are two causes of this problem:
* MaxScoreCollector does not set minCompetitiveScore of MinCompetitiveScoreAwareScorable newly generated for another index segment.
* MaxScoreCollector updates minCompetitiveScore only if maxScore is updated. This behavior is correct considering the purpose of MaxScoreCollector.

For details, see the attached pdf https://issues.apache.org/jira/secure/attachment/13019548/wand.pdf.
  • Loading branch information
chlorochrule authored Feb 11, 2021
1 parent 683a9bd commit 0cbb38f
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,12 @@ public ScoreMode scoreMode() {
}

@Override
public void setScorer(Scorable scorer) {
public void setScorer(Scorable scorer) throws IOException {
if (maxScore == Float.MIN_VALUE) {
scorer.setMinCompetitiveScore(0f);
} else {
scorer.setMinCompetitiveScore(Math.nextUp(maxScore));
}
this.scorer = scorer;
}

Expand Down

0 comments on commit 0cbb38f

Please sign in to comment.