benwtrent commented on code in PR #15500:
URL: https://github.com/apache/lucene/pull/15500#discussion_r2619678715


##########
lucene/core/src/java/org/apache/lucene/util/hnsw/HnswGraphSearcher.java:
##########
@@ -277,25 +287,16 @@ void searchLevel(
 
     int size = getGraphSize(graph);
 
-    prepareScratchState(size);
-
-    if (bulkNodes == null || bulkNodes.length < graph.maxConn() * 2) {
-      bulkNodes = new int[graph.maxConn() * 2];
-      bulkScores = new float[graph.maxConn() * 2];
+    prepareScratchState(size, graph.maxConn() * 2);
+    if (bulkScores == null || bulkScores.length < eps.length) {
+      bulkScores = new float[eps.length];
     }
-
-    for (int ep : eps) {
-      if (visited.getAndSet(ep) == false) {
-        if (results.earlyTerminated()) {
-          break;
-        }
-        float score = scorer.score(ep);
-        results.incVisitedCount(1);
-        candidates.add(ep, score);
-        if (acceptOrds == null || acceptOrds.get(ep)) {
-          results.collect(ep, score);
-        }
-      }
+    if (results.earlyTerminated()) {
+      return;
+    }

Review Comment:
   Without it, tests fail. I didn't want to bother changing tests and instead 
adjusted the code to be the same as before (checking for early termination on 
ep scoring).



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

Reply via email to