zacharymorn commented on code in PR #12194:
URL: https://github.com/apache/lucene/pull/12194#discussion_r1130391527


##########
lucene/core/src/java/org/apache/lucene/search/DocIdSetIterator.java:
##########
@@ -211,4 +216,22 @@ protected final int slowAdvance(int target) throws 
IOException {
    * may be a rough heuristic, hardcoded value, or otherwise completely 
inaccurate.
    */
   public abstract long cost();
+
+  /**
+   * Returns the next doc ID that may not be a match. Note that this API will 
essentially provide
+   * the following two guarantees:

Review Comment:
   Yeah I have been wondering about how to handle this case properly, hence the 
multiple `NO_MORE_DOCS` returned below. By making it illegal to call this 
method once the iterator is exhausted, do you mean we need to throw an 
exception here?  As this condition may be pretty common, I'm wondering if we 
could give callers an easier way to detect / handle this situation. Is it ok we 
always return the last non matching doc (or `maxDoc`) under this scenario, and 
warn callers to check if the iterator's current doc is `NO_MORE_DOCS` to 
detect? 



-- 
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

Reply via email to