Skip to content

Commit 46ce5b8

Browse files
[BUG]: <100 items, >20% delete Wrong distance comparison in local HNSW (chroma-core#4334)
2 parents 4101e95 + bcabb26 commit 46ce5b8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

rust/segment/src/local_hnsw.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ impl LocalHnswSegmentReader {
327327
// SAFETY(hammadb): We are sure that the heap has at least one element
328328
// because we insert until we have k elements.
329329
let top = max_heap.peek().unwrap();
330-
if top.measure < curr_distance {
330+
if top.measure > curr_distance {
331331
max_heap.pop();
332332
max_heap.push(RecordDistance {
333333
offset_id: *curr_id as u32,

0 commit comments

Comments
 (0)