Skip to content

Commit 978f713

Browse files
authored
Fix insufficient results during filtering. (#430)
Very similar in nature to #344
1 parent 28681fc commit 978f713

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

hnswlib/hnswalg.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,8 @@ class HierarchicalNSW : public AlgorithmInterface<dist_t> {
317317
while (!candidate_set.empty()) {
318318
std::pair<dist_t, tableint> current_node_pair = candidate_set.top();
319319

320-
if ((-current_node_pair.first) > lowerBound && (top_candidates.size() == ef || has_deletions == false)) {
320+
if ((-current_node_pair.first) > lowerBound &&
321+
(top_candidates.size() == ef || (!isIdAllowed && !has_deletions))) {
321322
break;
322323
}
323324
candidate_set.pop();

0 commit comments

Comments
 (0)