From 074223e5bc54c4ab5fd92613fd97ad6f65d4ce41 Mon Sep 17 00:00:00 2001 From: lixinguo Date: Tue, 24 Dec 2024 11:23:53 +0800 Subject: [PATCH] enhance: simplify the structure of search_params Signed-off-by: lixinguo --- pymilvus/client/prepare.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/pymilvus/client/prepare.py b/pymilvus/client/prepare.py index 586d7e5ae..f8a160092 100644 --- a/pymilvus/client/prepare.py +++ b/pymilvus/client/prepare.py @@ -978,7 +978,15 @@ def search_requests_with_expr( if param.get(HINTS) is not None: search_params[HINTS] = param[HINTS] - + + # after 2.5.1, all parameters of search_params can be written into one layer + # no more parameters will be written searchParams.params + # to ensure compatibility and milvus can still get a json format parameter + # try to write all the parameters under searchParams into searchParams.Params + for key, value in search_params.items(): + if key != "params": + params[key] = value + req_params = [ common_types.KeyValuePair(key=str(key), value=utils.dumps(value)) for key, value in search_params.items()