diff --git a/src/index.cpp b/src/index.cpp index ab8f8576..9b93709e 100644 --- a/src/index.cpp +++ b/src/index.cpp @@ -2072,9 +2072,8 @@ Option 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);