maedhroz commented on code in PR #4353:
URL: https://github.com/apache/cassandra/pull/4353#discussion_r2674141805
##########
src/java/org/apache/cassandra/index/sai/disk/v1/segment/VectorIndexSegmentSearcher.java:
##########
@@ -98,41 +118,44 @@ public KeyRangeIterator search(Expression exp,
AbstractBounds<PartitionPosition>
throw new
IllegalArgumentException(index.identifier().logMessage("Unsupported expression
during ANN index query: " + exp));
int topK = optimizeFor.topKFor(limit);
- BitsOrPostingList bitsOrPostingList =
bitsOrPostingListForKeyRange(context.vectorContext(), keyRange, topK);
- if (bitsOrPostingList.skipANN())
- return toPrimaryKeyIterator(bitsOrPostingList.postingList(),
context);
float[] queryVector =
index.termType().decomposeVector(exp.lower().value.raw.duplicate());
- VectorPostingList vectorPostings = graph.search(queryVector, topK,
limit, bitsOrPostingList.getBits());
- if (bitsOrPostingList.expectedNodesVisited >= 0)
- updateExpectedNodes(vectorPostings.getVisitedCount(),
bitsOrPostingList.expectedNodesVisited);
- return toPrimaryKeyIterator(vectorPostings, context);
+ CloseableIterator<RowIdWithScore> result = searchInternal(keyRange,
queryVector, limit, topK);
+ return toScoreSortedIterator(result);
}
/**
* Return bit set we need to search the graph; otherwise return posting
list to bypass the graph
Review Comment:
nit: It's a private method, so I'd just remove the out-of-date comment
altogether.
--
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]