jpountz commented on code in PR #1068: URL: https://github.com/apache/lucene/pull/1068#discussion_r966192242
########## lucene/core/src/java/org/apache/lucene/search/ConjunctionDISI.java: ########## @@ -281,6 +281,12 @@ private int doNext(int doc) throws IOException { advanceLead: for (; ; doc = lead.nextDoc()) { if (doc >= minLength) { + if (doc != NO_MORE_DOCS) { + lead.advance(NO_MORE_DOCS); + } + for (BitSetIterator iterator : bitSetIterators) { + iterator.setDocId(NO_MORE_DOCS); + } Review Comment: The `if` statement makes sense to me, but I'm curious how you managed to hit this case. This suggests that we create BitSets whose size is not `maxDoc`, do you know where this happens? The `for` loop should be unnecessary, there is no guarantee that all sub iterators advance to `NO_MORE_DOCS`. If this causes problems, then it means we have another bug somewhere else? -- 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