Skip to content

Commit 31a29d0

Browse files
xinhuitianfacebook-github-bot
authored andcommitted
HNSW search use efSearch from params if provided (facebookresearch#3233)
Summary: I found that HNSW search method uses its own efSearch to create candidates, which should be got from params if provided I think? Pull Request resolved: facebookresearch#3233 Reviewed By: algoriddle Differential Revision: D53342879 Pulled By: mdouze fbshipit-source-id: 4f47f19d3673d1bb8d7e8e82745f9e5c1b9afb42
1 parent c1822a8 commit 31a29d0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

faiss/impl/HNSW.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -829,7 +829,7 @@ HNSWStats HNSW::search(
829829
greedy_update_nearest(*this, qdis, level, nearest, d_nearest);
830830
}
831831

832-
int ef = std::max(efSearch, k);
832+
int ef = std::max(params ? params->efSearch : efSearch, k);
833833
if (search_bounded_queue) { // this is the most common branch
834834
MinimaxHeap candidates(ef);
835835

0 commit comments

Comments
 (0)