mayya-sharipova commented on a change in pull request #267:
URL: https://github.com/apache/lucene/pull/267#discussion_r700571931
##########
File path:
lucene/core/src/java/org/apache/lucene/util/hnsw/HnswGraphBuilder.java
##########
@@ -146,20 +168,72 @@ void addGraphNode(int node, float[] value) throws
IOException {
* nearest neighbors that are closer to the new node than they are to the
previously-selected
* neighbors
*/
- addDiverseNeighbors(node, candidates);
+ addDiverseNeighbors(0, node, candidates);
+ }
+
+ // build hierarchical navigable small world graph (multi-layered)
+ void buildHNSW(RandomAccessVectorValues vectors) throws IOException {
+ long start = System.nanoTime(), t = start;
+ // start at node 1! node 0 is added implicitly, in the constructor
+ for (int node = 1; node < vectors.size(); node++) {
+ addGraphNodeHNSW(node, vectors.vectorValue(node));
+ if (node % 10000 == 0) {
Review comment:
Addressed in 6a05951772cc72a1530f3fd863d906dc0e3bef88
--
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]