Github user jimczi commented on a diff in the pull request:
https://github.com/apache/lucene-solr/pull/495#discussion_r232993082
--- Diff:
lucene/core/src/java/org/apache/lucene/search/ConstantScoreScorer.java ---
@@ -49,15 +100,27 @@ public ConstantScoreScorer(Weight weight, float score,
DocIdSetIterator disi) {
public ConstantScoreScorer(Weight weight, float score, TwoPhaseIterator
twoPhaseIterator) {
super(weight);
this.score = score;
- this.twoPhaseIterator = twoPhaseIterator;
- this.disi = TwoPhaseIterator.asDocIdSetIterator(twoPhaseIterator);
+ this.approximation = new
DocIdSetIteratorWrapper(twoPhaseIterator.approximation());
+ this.twoPhaseIterator = new TwoPhaseIteratorWrapper(twoPhaseIterator,
this.approximation);
+ this.disi = new
DocIdSetIteratorWrapper(TwoPhaseIterator.asDocIdSetIterator(this.twoPhaseIterator));
}
@Override
public float getMaxScore(int upTo) throws IOException {
return score;
}
+ @Override
+ public void setMinCompetitiveScore(float minScore) throws IOException {
+ if (minScore > score) {
--- End diff --
See my comment above but it should be enough to reset
`approximation.delegate` if you wrap the twoPhaseIterator correctly.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]