mirror of https://github.com/apache/lucene.git
Call HnswGraphBuilder.getCompletedGraph() in 94/95 back-compat writers (#13654)
This commit is contained in:
parent
a40bb39195
commit
2b0c6cdcbc
|
@ -693,9 +693,9 @@ public final class Lucene94HnswVectorsWriter extends KnnVectorsWriter {
|
|||
lastDocID = docID;
|
||||
}
|
||||
|
||||
OnHeapHnswGraph getGraph() {
|
||||
OnHeapHnswGraph getGraph() throws IOException {
|
||||
if (vectors.size() > 0) {
|
||||
return hnswGraphBuilder.getGraph();
|
||||
return hnswGraphBuilder.getCompletedGraph();
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
|
|
|
@ -732,9 +732,9 @@ public final class Lucene95HnswVectorsWriter extends KnnVectorsWriter {
|
|||
lastDocID = docID;
|
||||
}
|
||||
|
||||
OnHeapHnswGraph getGraph() {
|
||||
OnHeapHnswGraph getGraph() throws IOException {
|
||||
if (vectors.size() > 0) {
|
||||
return hnswGraphBuilder.getGraph();
|
||||
return hnswGraphBuilder.getCompletedGraph();
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
|
|
|
@ -412,6 +412,7 @@ public class HnswGraphBuilder implements HnswBuilder {
|
|||
}
|
||||
|
||||
void finish() throws IOException {
|
||||
// System.out.println("finish " + frozen);
|
||||
connectComponents();
|
||||
frozen = true;
|
||||
}
|
||||
|
@ -438,7 +439,7 @@ public class HnswGraphBuilder implements HnswBuilder {
|
|||
maxConn *= 2;
|
||||
}
|
||||
List<Component> components = HnswUtil.components(hnsw, level, notFullyConnected, maxConn);
|
||||
// System.out.println("HnswGraphBuilder.connectComponents " + components);
|
||||
// System.out.println("HnswGraphBuilder.connectComponents level=" + level + ": " + components);
|
||||
boolean result = true;
|
||||
if (components.size() > 1) {
|
||||
// connect other components to the largest one
|
||||
|
|
Loading…
Reference in New Issue