Skip to content

Open Source alternative to Algolia + Pinecone and an Easier-to-Use alternative to ElasticSearch ⚡ 🔍 ✨ Fast, typo tolerant, in-memory fuzzy Search Engine for building delightful search experiences

Fix approximation logic of filter matches in case of `!=`.

Harpreet Sangar4abe7b6bee60
diff --git a/src/index.cpp b/src/index.cpp
index 0a6c3a20..824c1723 100644
--- a/src/index.cpp
+++ b/src/index.cpp
@@ -2094,9 +2094,8 @@ Option<bool> Index::_approximate_filter_ids(const filter& a_filter,
}
}
- if (a_filter.apply_not_equals) {
- auto all_ids_size = seq_ids->num_ids();
- filter_ids_length = (all_ids_size - filter_ids_length);
+ if (a_filter.apply_not_equals && filter_ids_length == 0) {
+ filter_ids_length = seq_ids->num_ids();
}
return Option(true);