mccullocht commented on code in PR #13181: URL: https://github.com/apache/lucene/pull/13181#discussion_r1525162554
########## lucene/core/src/java/org/apache/lucene/search/AbstractKnnVectorQuery.java: ########## @@ -190,12 +190,13 @@ protected TopDocs exactSearch(LeafReaderContext context, DocIdSetIterator accept if (vectorScorer == null) { return NO_RESULTS; } + DocIdSetIterator vectorIterator = vectorScorer.iterator(); HitQueue queue = new HitQueue(k, true); ScoreDoc topDoc = queue.top(); int doc; while ((doc = acceptIterator.nextDoc()) != DocIdSetIterator.NO_MORE_DOCS) { - boolean advanced = vectorScorer.advanceExact(doc); - assert advanced; + vectorIterator.advance(doc); + assert vectorIterator.docID() == doc; Review Comment: skip the document if it doesn't match? i'm guessing it would be an easily predicted branch and it's possible that the filter query could yield a document that doesn't have a vector. -- 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