jpountz commented on PR #14475: URL: https://github.com/apache/lucene/pull/14475#issuecomment-2797989784
Indeed `advanceExact` is ofter used from within collectors. It proved often faster than calling `advance` and checking if it returns the target doc ID. I agree that it is not great the way it is. I was actually thinking of going one step further compared with your suggestion and adding `advanceExact` directly to `DocIdSetIterator`, changing its contract to no longer guarantee that `docID()` returns the target if `advanceExact` returns false, and adding a default implementation that calls `advance`. The benefit of adding `advanceExact` directly to `DocIdSetIterator` is that then we no longer need to duplicate (and increase polymorphism) impls such as the one returned by `DocIdSetIterator#all` for both the case when it supports `advanceExact` and the case when it doesn't. -- 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