Only attempt to connect components when entry point is valid (#13660)

* Only attempt to connect components when entry point is valid

* iter
This commit is contained in:
Benjamin Trent 2024-08-19 08:36:52 -04:00 committed by GitHub
parent 299d7f6721
commit 1c9bd6bdb4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 0 deletions

View File

@ -454,6 +454,9 @@ public class HnswGraphBuilder implements HnswBuilder {
int[] eps = new int[1]; int[] eps = new int[1];
for (Component c : components) { for (Component c : components) {
if (c != c0) { if (c != c0) {
if (c.start() == NO_MORE_DOCS) {
continue;
}
beam.clear(); beam.clear();
eps[0] = c0.start(); eps[0] = c0.start();
RandomVectorScorer scorer = scorerSupplier.scorer(c.start()); RandomVectorScorer scorer = scorerSupplier.scorer(c.start());