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