dnhatn commented on code in PR #15173:
URL: https://github.com/apache/lucene/pull/15173#discussion_r2337009753
##########
lucene/core/src/java/org/apache/lucene/search/DocIdStream.java:
##########
@@ -58,6 +58,22 @@ public int count() throws IOException {
// so would defeat the purpose of collecting hits via a DocIdStream.
public abstract int count(int upTo) throws IOException;
+ /**
+ * Copy some matching doc IDs into the provided array and return the number
of copied elements. A
+ * return value of {@code 0} indicates that there are no remaining doc IDs.
The given array must
+ * not be empty.
+ */
+ public int intoArray(int[] array) {
+ return intoArray(DocIdSetIterator.NO_MORE_DOCS, array);
+ }
+
+ /**
+ * Copy some matching doc IDs under {@code upTo} (exclusive) into the
provided array and return
+ * the number of copied elements. A return value of {@code 0} indicates that
there are no matching
+ * doc IDs under {@code upTo} anymore. The given array must not be empty.
+ */
+ public abstract int intoArray(int upTo, int[] array);
Review Comment:
Can we add an offset to the destination array?
--
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]