Skip to content

Commit 2beb2f8

Browse files
fix test
1 parent cd926c3 commit 2beb2f8

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

tok/hnsw/persistent_hnsw.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,6 @@ func (ph *persistentHNSW[T]) MergeResults(ctx context.Context, c index.CacheType
354354
})
355355

356356
uids := []uint64{}
357-
// out of range error
358357
for i := range maxResults {
359358
if i > len(result) {
360359
break

tok/partitioned_hnsw/partitioned_hnsw.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,11 @@ func (ph *partitionedHNSW[T]) Search(ctx context.Context, txn index.CacheType, q
209209
}(index)
210210
}
211211
wg.Wait()
212+
213+
if len(res) == 0 {
214+
return res, nil
215+
}
216+
212217
return ph.clusterMap[0].MergeResults(ctx, txn, res, query, maxResults, filter)
213218
}
214219

worker/task.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ func (qs *queryState) handleValuePostings(ctx context.Context, args funcArgs) er
368368

369369
nnUids, err := indexer.Search(ctx, qc, srcFn.vectorInfo,
370370
int(numNeighbors), index.AcceptAll[float32])
371-
if err != nil {
371+
if err != nil && !strings.Contains(err.Error(), hnsw.EmptyHNSWTreeError+": "+badger.ErrKeyNotFound.Error()) {
372372
return err
373373
}
374374

0 commit comments

Comments
 (0)