Skip to content

Commit 7b14cac

Browse files
added changes
1 parent 09f4093 commit 7b14cac

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

tok/hnsw/persistent_hnsw.go

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,20 @@ func (ph *persistentHNSW[T]) NumThreads() int {
141141
}
142142

143143
func (ph *persistentHNSW[T]) BuildInsert(ctx context.Context, uid uint64, vec []T) error {
144-
_, err := ph.Insert(ctx, ph.cache, uid, vec)
144+
newPh := &persistentHNSW[T]{
145+
maxLevels: ph.maxLevels,
146+
efConstruction: ph.efConstruction,
147+
efSearch: ph.efSearch,
148+
pred: ph.pred,
149+
vecEntryKey: ph.vecEntryKey,
150+
vecKey: ph.vecKey,
151+
vecDead: ph.vecDead,
152+
simType: ph.simType,
153+
floatBits: ph.floatBits,
154+
nodeAllEdges: make(map[uint64][][]uint64),
155+
cache: ph.cache,
156+
}
157+
_, err := newPh.Insert(ctx, ph.cache, uid, vec)
145158
return err
146159
}
147160

0 commit comments

Comments
 (0)