alessandrobenedetti commented on code in PR #12314:
URL: https://github.com/apache/lucene/pull/12314#discussion_r1238063391


##########
lucene/core/src/java/org/apache/lucene/util/hnsw/HnswGraphSearcher.java:
##########
@@ -248,35 +247,41 @@ public NeighborQueue searchLevel(
       RandomAccessVectorValues<T> vectors,
       HnswGraph graph)
       throws IOException {
-    return searchLevel(query, topK, level, eps, vectors, graph, null, 
Integer.MAX_VALUE);
+    return searchLevel(query, topK, level, eps, vectors, graph, null, 
Integer.MAX_VALUE, false);
   }
 
   private NeighborQueue searchLevel(
-      T query,
-      int topK,
-      int level,
-      final int[] eps,
-      RandomAccessVectorValues<T> vectors,
-      HnswGraph graph,
-      Bits acceptOrds,
-      int visitedLimit)
-      throws IOException {
+          T query,
+          int topK,
+          int level,
+          final int[] entryPoints,
+          RandomAccessVectorValues<T> vectors,
+          HnswGraph graph,
+          Bits acceptOrds,
+          int visitedLimit,
+          boolean multiValued)
+          throws IOException {
     int size = graph.size();
     NeighborQueue results = new NeighborQueue(topK, false);
     prepareScratchState(vectors.size());
 
-    int numVisited = 0;
-    for (int ep : eps) {
-      if (visited.getAndSet(ep) == false) {
-        if (numVisited >= visitedLimit) {
+    int vectorIdsVisited = 0;
+    for (int vectorId : entryPoints) {
+      if (visited.getAndSet(vectorId) == false) {
+        if (vectorIdsVisited >= visitedLimit) {
           results.markIncomplete();
           break;
         }
-        float score = compare(query, vectors, ep);
-        numVisited++;
-        candidates.add(ep, score);
-        if (acceptOrds == null || acceptOrds.get(ep)) {
-          results.add(ep, score);
+        float score = compare(query, vectors, vectorId);
+        vectorIdsVisited++;
+        candidates.add(vectorId, score);
+        int docId = vectors.ordToDoc(vectorId);
+        if (acceptOrds == null || acceptOrds.get(vectorId)) {

Review Comment:
   nice catch @benwtrent, I reviewed the commit history and the change got lost 
in one of the thousands merges.
   I've restored it to the correct form acceptOrds.get(docId) now!
   



-- 
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

Reply via email to