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


##########
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:
   > By making it illegal to call this method once the iterator is exhausted, 
do you mean we need to throw an exception here?
   
   No I was thinking of just documenting the behavior as undefined. And throw 
assertions in AssertingScorer.
   
   > 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?
   
   Yes, exactly. This is the same for `nextDoc` or `advance`, it is illegal to 
call these methods when the current doc is NO_MORE_DOCS.



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

Reply via email to