costin opened a new pull request, #16144: URL: https://github.com/apache/lucene/pull/16144
Split from #16143. Makes the batch-collection scorer-positioning rule explicit, which is the contract #16141 had to rely on. The constant-score bulk routing work exposed a small contract gap around batch collection: `collect(DocIdStream)` and `collectRange()` can collect docs without positioning the scorer on each doc, so collectors should not call `Scorable.score()` from those batch methods. This makes that explicit in `LeafCollector`, teaches `AssertingLeafCollector` to catch accidental score calls when the installed `Scorable` is an iterator-backed `Scorer`, and updates `RangeBulkScorer` to pass a synthetic constant-score `Scorable` instead of a scorer whose iterator is also being consumed by the bulk scorer. I kept the assertion scoped to iterator-backed `Scorer`s because Lucene has legitimate synthetic `Scorable`s used by bulk scorers, and a broader guard produced false positives rather than a useful contract check. For safety, I've added a dedicated test case. -- 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]
