fix: optimize BM25 err message (#37074)

issue: https://github.com/milvus-io/milvus/issues/37022

Signed-off-by: Buqian Zheng <zhengbuqian@gmail.com>
pull/36693/head
Buqian Zheng 2024-10-25 14:35:45 +08:00 committed by GitHub
parent 84d48b498b
commit 088d5d7d76
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 3 deletions

View File

@ -1013,12 +1013,12 @@ func (sd *shardDelegator) buildBM25IDF(req *internalpb.SearchRequest) (float64,
proto.Unmarshal(req.GetPlaceholderGroup(), pb)
if len(pb.Placeholders) != 1 || len(pb.Placeholders[0].Values) == 0 {
return 0, merr.WrapErrParameterInvalidMsg("please provide varchar for bm25")
return 0, merr.WrapErrParameterInvalidMsg("please provide varchar for BM25 Function based search")
}
holder := pb.Placeholders[0]
if holder.Type != commonpb.PlaceholderType_VarChar {
return 0, fmt.Errorf("can't build BM25 IDF for data not varchar")
return 0, merr.WrapErrParameterInvalidMsg(fmt.Sprintf("please provide varchar for BM25 Function based search, got %s", holder.Type.String()))
}
str := funcutil.GetVarCharFromPlaceholder(holder)

View File

@ -3089,7 +3089,7 @@ class TestSearchWithFullTextSearchNegative(TestcaseBase):
search_data = cf.gen_vectors(nb=nq, dim=1000, vector_data_type="FLOAT_VECTOR")
log.info(f"search data: {search_data}")
error = {ct.err_code: 65535,
ct.err_msg: "can't build BM25 IDF for data not varchar"}
ct.err_msg: "please provide varchar for BM25 Function based search"}
collection_w.search(
data=search_data,
anns_field="text_sparse_emb",