SOLR-15114: WAND does not work correctly on multiple segments (#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.
This commit is contained in:
Naoto MINAMI 2021-02-12 02:10:03 +09:00 committed by GitHub
parent 683a9bd78a
commit 0cbb38ff4a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 1 deletions

View File

@ -41,7 +41,12 @@ public class MaxScoreCollector extends SimpleCollector {
}
@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;
}