Skip to content

Commit

Permalink
enhance: [2.5] support hints param (#2442)
Browse files Browse the repository at this point in the history
issue: milvus-io/milvus#37360
pr: #2408

Signed-off-by: chasingegg <[email protected]>
  • Loading branch information
chasingegg authored Dec 13, 2024
1 parent 6fcbb49 commit be184b5
Show file tree
Hide file tree
Showing 2 changed files with 5 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 @@ -17,6 +17,7 @@
ITERATOR_FIELD = "iterator"
ITERATOR_SESSION_TS_FIELD = "iterator_session_ts"
PAGE_RETAIN_ORDER_FIELD = "page_retain_order"
HINTS = "hints"

RANKER_TYPE_RRF = "rrf"
RANKER_TYPE_WEIGHTED = "weighted"
Expand Down
4 changes: 4 additions & 0 deletions pymilvus/client/prepare.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
DYNAMIC_FIELD_NAME,
GROUP_BY_FIELD,
GROUP_SIZE,
HINTS,
ITERATOR_FIELD,
PAGE_RETAIN_ORDER_FIELD,
RANK_GROUP_SCORER,
Expand Down Expand Up @@ -975,6 +976,9 @@ def search_requests_with_expr(
if anns_field:
search_params["anns_field"] = anns_field

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

req_params = [
common_types.KeyValuePair(key=str(key), value=utils.dumps(value))
for key, value in search_params.items()
Expand Down

0 comments on commit be184b5

Please sign in to comment.