From 8d22d3841b18c7c7bad68ceecccaecd50d96ca98 Mon Sep 17 00:00:00 2001 From: MrPresent-Han Date: Thu, 19 Dec 2024 05:49:01 -0500 Subject: [PATCH] enhance: refine search_group_by_example(#2481) Signed-off-by: MrPresent-Han --- examples/search_group_by.py | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/examples/search_group_by.py b/examples/search_group_by.py index 5ad3c92e6..0397e3659 100644 --- a/examples/search_group_by.py +++ b/examples/search_group_by.py @@ -67,19 +67,8 @@ def print_res(result: List[List[dict]]): vector_to_search = rng.random((nq, DIM), np.float32) -# just search_group_by, no group_size, only 1 entities per group +# only 1 entity per group of AGE res = milvus_client.search(collection_name, data=vector_to_search, limit=10, anns_field=PICTURE, output_fields=[USER_ID, AGE], group_by_field=AGE) print_res(res) -# search_group_by, with group_size=3, but not strict_group_size, entity number in per group may be 1~3 -res = milvus_client.search(collection_name, data=vector_to_search, limit=10, anns_field=PICTURE, - output_fields=[USER_ID, AGE], group_by_field=AGE, group_size=3) -print_res(res) - -# search_group_by, with group_size=3, and strict_group_size=true, entity number -# in per group will be exactly 3 if data's sufficient -res = milvus_client.search(collection_name, data=vector_to_search, limit=10, anns_field=PICTURE, - output_fields=[USER_ID, AGE], group_by_field=AGE, group_size=3, strict_group_size=True) -print_res(res) -