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


##########
lucene/core/src/java/org/apache/lucene/util/hnsw/HnswGraphSearcher.java:
##########
@@ -100,19 +100,10 @@ private static void search(
       HnswGraphSearcher graphSearcher,
       Bits acceptOrds)
       throws IOException {
-    int initialEp = graph.entryNode();
-    if (initialEp == -1) {
-      return;
+    int ep = graphSearcher.findBestEntryPoint(scorer, graph, knnCollector);

Review Comment:
   I think you should still check `collector.earlyTerminated()` after finding 
the best entry point as we increment the visited count after each check. 
Meaning we could have visited too many by one, and there is no point in 
continuing.



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