jpountz opened a new pull request, #12400: URL: https://github.com/apache/lucene/pull/12400
`AssertingBulkScorer` asserts that the return value of `BulkScorer#score` may not be in `[maxDoc, NO_MORE_DOCS)`. While this is not part of the contract of `BulkScorer#score`, a reasonable implementation should never have return values in this range, as it would suggest that more matches need collecting when we're already out of the range of valid doc IDs. So this generally indicates a bug. `MaxScoreBulkScorer` failed this assertion, because it can sometimes skip the requested window of doc IDs, when the sum of maximum scores would be less than the minimum competitive score. In that case, the best information it has is that there are no matches in the window, but it cannot give a good estimate of the next potential match. This assertion in `AssertingBulkScorer` looks sane to me, so I made a small change to `MaxScoreBulkScorer` to make sure it meets `AssertingScorer`'s expectations. This is done in a place that is only called once per scored window, so it should not have a noticeable performance impact. -- 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: issues-unsubscr...@lucene.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org