From 9e3efa06be783f342daefc9570bba168213537f7 Mon Sep 17 00:00:00 2001 From: zhagnlu <1542303831@qq.com> Date: Sat, 28 Sep 2024 17:45:16 +0800 Subject: [PATCH] fix:fix empty search result bug (#36582) #36450 Signed-off-by: luzhang Co-authored-by: luzhang --- internal/core/src/query/ExecPlanNodeVisitor.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/internal/core/src/query/ExecPlanNodeVisitor.cpp b/internal/core/src/query/ExecPlanNodeVisitor.cpp index ca29056da3..58d7cbcf12 100644 --- a/internal/core/src/query/ExecPlanNodeVisitor.cpp +++ b/internal/core/src/query/ExecPlanNodeVisitor.cpp @@ -65,7 +65,7 @@ class ExecPlanNodeVisitor : PlanNodeVisitor { } // namespace impl static SearchResult -empty_search_result(int64_t num_queries, SearchInfo& search_info) { +empty_search_result(int64_t num_queries) { SearchResult final_result; final_result.total_nq_ = num_queries; final_result.unity_topK_ = 0; // no result @@ -119,7 +119,8 @@ ExecPlanNodeVisitor::VectorVisitorImpl(VectorPlanNode& node) { // PreExecute: skip all calculation if (active_count == 0) { - search_result_opt_ = std::move(SearchResult()); + search_result_opt_ = std::move( + empty_search_result(placeholder_group_->at(0).num_of_queries_)); return; }