mirror of https://github.com/apache/lucene.git
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:
parent
683a9bd78a
commit
0cbb38ff4a
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue