Skip to content

Commit

Permalink
Fix insufficient results during filtering. (#430)
Browse files Browse the repository at this point in the history
Very similar in nature to #344
  • Loading branch information
kishorenc authored Jan 14, 2023
1 parent 28681fc commit 978f713
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion hnswlib/hnswalg.h
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,8 @@ class HierarchicalNSW : public AlgorithmInterface<dist_t> {
while (!candidate_set.empty()) {
std::pair<dist_t, tableint> current_node_pair = candidate_set.top();

if ((-current_node_pair.first) > lowerBound && (top_candidates.size() == ef || has_deletions == false)) {
if ((-current_node_pair.first) > lowerBound &&
(top_candidates.size() == ef || (!isIdAllowed && !has_deletions))) {
break;
}
candidate_set.pop();
Expand Down

0 comments on commit 978f713

Please sign in to comment.