diff --git a/thirdparty/DiskANN/src/pq_flash_index.cpp b/thirdparty/DiskANN/src/pq_flash_index.cpp index a80a4ea69..261666f61 100644 --- a/thirdparty/DiskANN/src/pq_flash_index.cpp +++ b/thirdparty/DiskANN/src/pq_flash_index.cpp @@ -1001,7 +1001,7 @@ namespace diskann { float query_norm = query_norm_opt.value(); auto ctx = this->reader->get_ctx(); - if (!bitset_view.empty() && bitset_view.count() > bitset_view.size() * kDiskAnnBruteForceFilterRate) { + if (!bitset_view.empty() && bitset_view.count() >= bitset_view.size() * kDiskAnnBruteForceFilterRate) { brute_force_beam_search(data, query_norm, k_search, indices, distances, beam_width, ctx, stats, feder, bitset_view); this->thread_data.push(data); diff --git a/thirdparty/hnswlib/hnswlib/hnswalg.h b/thirdparty/hnswlib/hnswlib/hnswalg.h index 1b7bf4b94..7d7a6b521 100644 --- a/thirdparty/hnswlib/hnswlib/hnswalg.h +++ b/thirdparty/hnswlib/hnswlib/hnswalg.h @@ -35,7 +35,7 @@ namespace hnswlib { typedef unsigned int tableint; typedef unsigned int linklistsizeint; -constexpr float kHnswBruteForceFilterRate = 0.8f; +constexpr float kHnswBruteForceFilterRate = 0.93f; template class HierarchicalNSW : public AlgorithmInterface { @@ -1030,7 +1030,7 @@ class HierarchicalNSW : public AlgorithmInterface { if (cur_element_count == 0) return {}; - if (!bitset.empty() && bitset.count() > (cur_element_count * kHnswBruteForceFilterRate)) { + if (!bitset.empty() && bitset.count() >= (cur_element_count * kHnswBruteForceFilterRate)) { assert(cur_element_count == bitset.size()); knowhere::ResultMaxHeap max_heap(k); for (labeltype id = 0; id < cur_element_count; ++id) {