From 3ffe126dc73abd21b6b98c86ec274ba578bbd70c Mon Sep 17 00:00:00 2001 From: congqixia Date: Mon, 1 Apr 2024 10:11:12 +0800 Subject: [PATCH] enhance: Refine error message when search vector type not matched (#31725) Previously the error message only reports the case happened without field name and vector type. This PR add field name and vector type information in the error messages. Signed-off-by: Congqi Xia --- internal/core/src/query/Plan.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/internal/core/src/query/Plan.cpp b/internal/core/src/query/Plan.cpp index d937fce111..8e72f59ba1 100644 --- a/internal/core/src/query/Plan.cpp +++ b/internal/core/src/query/Plan.cpp @@ -47,7 +47,11 @@ ParsePlaceholderGroup(const Plan* plan, auto& field_meta = plan->schema_[field_id]; AssertInfo(static_cast(field_meta.get_data_type()) == static_cast(info.type()), - "vector type must be the same"); + "vector type must be the same, field {} - type {}, search " + "info type {}", + field_meta.get_name().get(), + field_meta.get_data_type(), + static_cast(info.type())); element.num_of_queries_ = info.values_size(); AssertInfo(element.num_of_queries_ > 0, "must have queries"); if (info.type() ==