MarcusSorealheis commented on code in PR #12235:
URL: https://github.com/apache/lucene/pull/12235#discussion_r1175657275
##########
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:
Nit: I know we use `nbrNbr` in a [few more
places](https://github.com/apache/lucene/blob/4deb0003c425bfaff3923661512c44a315172854/lucene/backward-codecs/src/java/org/apache/lucene/backward_codecs/lucene90/Lucene90HnswGraphBuilder.java#L186),
but as you have reminded me, the nondescript names could make it more
difficult for others to understand the code and participate.
Is there another way to express this to make it easier for people to
read/scan? `neighborArray` to be most explicit, `candidateNeighbors` or
something else? You would only need to change two other files to preserve
consistency if you elected to move from `nbrNbr`
--
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]