jpountz commented on code in PR #14679: URL: https://github.com/apache/lucene/pull/14679#discussion_r2098761902
########## lucene/core/src/java/org/apache/lucene/index/PostingsEnum.java: ########## @@ -97,4 +98,44 @@ protected PostingsEnum() {} * anything (neither members of the returned BytesRef nor bytes in the byte[]). */ public abstract BytesRef getPayload() throws IOException; + + /** + * Return a new batch of doc IDs and frequencies, starting at the current doc ID, and ending + * before {@code upTo}. + * + * <p>An empty return value indicates that there are no postings left between the current doc ID + * and {@code upTo}. + * + * <p>This method behaves as if implemented as below, which is the default implementation: + * + * <pre class="prettyprint"> + * int batchSize = 16; + * reuse.grow(batchSize); + * int size = 0; + * for (int doc = docID(); doc < upTo && size < batchSize; doc = nextDoc()) { + * reuse.docs[size] = doc; + * reuse.freqs[size] = freq(); + * ++size; + * } + * reuse.size = size; + * return reuse; + * </pre> + * + * <p><b>NOTE</b>: The returned {@link DocAndFreqBuffer} should not hold references to internal Review Comment: I ended up not applying this suggestion, or the API calls would have looked awkward. I hope this is ok. -- 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