MarcusSorealheis commented on code in PR #12235: URL: https://github.com/apache/lucene/pull/12235#discussion_r1175891696
########## lucene/core/src/java/org/apache/lucene/util/hnsw/HnswGraphBuilder.java: ########## @@ -306,7 +308,7 @@ private void addDiverseNeighbors(int level, int node, NeighborQueue candidates) for (int i = 0; i < size; i++) { int nbr = neighbors.node[i]; NeighborArray nbrNbr = hnsw.getNeighbors(level, nbr); - nbrNbr.insertSorted(node, neighbors.score[i]); + nbrNbr.addOutOfOrder(node, neighbors.score[i]); Review Comment: I think `neighborArray` would be an improvement but not completely accurate. `neighborsArray` would be implicitly good, too, yet implicit is not good enough and it's not clear about the relationship with the neighbor in focus. `nbrsOfNbr` is even more clear. I'd recommend going with your suggestion. -- 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