costin commented on code in PR #16141:
URL: https://github.com/apache/lucene/pull/16141#discussion_r3315513146
##########
lucene/core/src/java/org/apache/lucene/search/ConstantScoreScorer.java:
##########
@@ -147,6 +147,10 @@ public float score() throws IOException {
return score;
}
+ boolean canBulkCollectDocIdStream() {
+ return scoreMode != ScoreMode.TOP_SCORES;
+ }
Review Comment:
Thanks, the `AssertingScorer` comment pointed at the real issue. The fast
path was gated only on `scoreMode != TOP_SCORES`, but `ScoreMode.COMPLETE` can
still have collectors that call `scorer.score()` while replaying docs from the
`DocIdStream`. Since `intoBitSet()` advances the iterator before replay, that
violates the scorer positioning contract and trips `AssertingScorer`.
I updated the gate to only use `DocIdStream` batching when
`scoreMode.needsScores() == false`, and added a regression test for
`ScoreMode.COMPLETE` staying on the per-doc path.
--
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]