Skip to content

Commit

Permalink
feat: support group_size parameter for search_group_by (milvus-io#2130)
Browse files Browse the repository at this point in the history
related: milvus-io#2129

Signed-off-by: MrPresent-Han <[email protected]>
Co-authored-by: MrPresent-Han <[email protected]>
  • Loading branch information
MrPresent-Han and MrPresent-Han authored Jun 24, 2024
1 parent 08eff03 commit 7c09c5c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions pymilvus/client/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
DEFAULT_RESOURCE_GROUP = "__default_resource_group"
REDUCE_STOP_FOR_BEST = "reduce_stop_for_best"
GROUP_BY_FIELD = "group_by_field"
GROUP_SIZE = "group_size"
ITERATOR_FIELD = "iterator"

RANKER_TYPE_RRF = "rrf"
Expand Down
5 changes: 5 additions & 0 deletions pymilvus/client/prepare.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
from .constants import (
DEFAULT_CONSISTENCY_LEVEL,
GROUP_BY_FIELD,
GROUP_SIZE,
ITERATOR_FIELD,
REDUCE_STOP_FOR_BEST,
)
Expand Down Expand Up @@ -667,6 +668,10 @@ def search_requests_with_expr(
if group_by_field is not None:
search_params[GROUP_BY_FIELD] = group_by_field

group_size = kwargs.get(GROUP_SIZE)
if group_size is not None:
search_params[GROUP_SIZE] = group_size

if param.get("metric_type") is not None:
search_params["metric_type"] = param["metric_type"]

Expand Down

0 comments on commit 7c09c5c

Please sign in to comment.