From 132b62a21ad23de444a3057b0b5aea9f86334ce1 Mon Sep 17 00:00:00 2001 From: JieCin <1875919175@qq.com> Date: Thu, 29 Jun 2023 03:15:03 +0800 Subject: [PATCH] Output distance file in memory index search (#382) * Output distance file * fix --------- Co-authored-by: Shengjie Qian --- apps/search_memory_index.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/apps/search_memory_index.cpp b/apps/search_memory_index.cpp index 4af0266d6..ca3045331 100644 --- a/apps/search_memory_index.cpp +++ b/apps/search_memory_index.cpp @@ -247,8 +247,14 @@ int search_memory_index(diskann::Metric &metric, const std::string &index_path, diskann::cout << "Ignoring search with L:" << L << " since it's smaller than K:" << recall_at << std::endl; continue; } - std::string cur_result_path = result_path_prefix + "_" + std::to_string(L) + "_idx_uint32.bin"; + std::string cur_result_path_prefix = result_path_prefix + "_" + std::to_string(L); + + std::string cur_result_path = cur_result_path_prefix + "_idx_uint32.bin"; diskann::save_bin(cur_result_path, query_result_ids[test_id].data(), query_num, recall_at); + + cur_result_path = cur_result_path_prefix + "_dists_float.bin"; + diskann::save_bin(cur_result_path, query_result_dists[test_id].data(), query_num, recall_at); + test_id++; }