jtibshirani commented on a change in pull request #239:
URL: https://github.com/apache/lucene/pull/239#discussion_r685297886



##########
File path: lucene/core/src/java/org/apache/lucene/util/hnsw/HnswGraph.java
##########
@@ -109,13 +115,14 @@ public static NeighborQueue search(
       if (visited.get(entryPoint) == false) {
         visited.set(entryPoint);
         // explore the topK starting points of some random numSeed probes
-        results.add(entryPoint, similarityFunction.compare(query, 
vectors.vectorValue(entryPoint)));
+        float score = similarityFunction.compare(query, 
vectors.vectorValue(entryPoint));
+        candidates.add(entryPoint, score);
+        if (acceptOrds == null || acceptOrds.get(entryPoint)) {

Review comment:
       I tried both ways and liked this approach because it matches the API for 
`BulkScorer#score` and the return value for `getLiveDocs`. For me this 
consistency was worth it, even though in isolation it's slightly less clean.




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