[ci skip] fix initial neighor connection
@@ -139,6 +139,7 @@ func (n *neighborFinderConnector) doAtLevel(level int) error {
}
}
+ if len(neighbors) > 0 {
n.entryPointID = neighbors[0]
dist, ok, err := n.graph.distBetweenNodeAndVec(n.entryPointID, n.nodeVec)
if err != nil {
@@ -150,6 +151,7 @@ func (n *neighborFinderConnector) doAtLevel(level int) error {
}
n.entryPointDist = dist
+ }
return nil
}
