From 31a29d03784b49183df31debedcbf26a1a33148d Mon Sep 17 00:00:00 2001 From: xinhuitian Date: Fri, 2 Feb 2024 02:31:57 -0800 Subject: [PATCH] HNSW search use efSearch from params if provided (#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: https://github.com/facebookresearch/faiss/pull/3233 Reviewed By: algoriddle Differential Revision: D53342879 Pulled By: mdouze fbshipit-source-id: 4f47f19d3673d1bb8d7e8e82745f9e5c1b9afb42 --- faiss/impl/HNSW.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/faiss/impl/HNSW.cpp b/faiss/impl/HNSW.cpp index fb4de67899..a9fb9daf5b 100644 --- a/faiss/impl/HNSW.cpp +++ b/faiss/impl/HNSW.cpp @@ -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);