fix:fix empty search result bug (#36582)

#36450

Signed-off-by: luzhang <luzhang@zilliz.com>
Co-authored-by: luzhang <luzhang@zilliz.com>
This commit is contained in:
zhagnlu 2024-09-28 17:45:16 +08:00 committed by GitHub
parent 80f25d497f
commit 9e3efa06be
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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;
}