jtibshirani commented on code in PR #958: URL: https://github.com/apache/lucene/pull/958#discussion_r898455193
########## lucene/core/src/java/org/apache/lucene/util/hnsw/HnswGraphSearcher.java: ########## @@ -87,10 +87,14 @@ public static NeighborQueue search( int numVisited = 0; for (int level = graph.numLevels() - 1; level >= 1; level--) { results = graphSearcher.searchLevel(query, 1, level, eps, vectors, graph, null, visitedLimit); - eps[0] = results.pop(); numVisited += results.visitedCount(); visitedLimit -= results.visitedCount(); + + if (results.incomplete()) { Review Comment: It seems like we should return here instead of breaking. If we've hit the visitedLimit, then we don't want to continue on and attempt to search the last level. -- 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