Skip to content

Commit

Permalink
HNSW search use efSearch from params if provided (#3233)
Browse files Browse the repository at this point in the history
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: #3233

Reviewed By: algoriddle

Differential Revision: D53342879

Pulled By: mdouze

fbshipit-source-id: 4f47f19d3673d1bb8d7e8e82745f9e5c1b9afb42
  • Loading branch information
xinhuitian authored and facebook-github-bot committed Feb 2, 2024
1 parent c1822a8 commit 31a29d0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion faiss/impl/HNSW.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -829,7 +829,7 @@ HNSWStats HNSW::search(
greedy_update_nearest(*this, qdis, level, nearest, d_nearest);
}

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

Expand Down

0 comments on commit 31a29d0

Please sign in to comment.