Skip to content

Commit

Permalink
fix: [GoSDK] Unify AnnRequest creation and fix nil map (#39665)
Browse files Browse the repository at this point in the history
Related to #39559

Signed-off-by: Congqi Xia <[email protected]>
  • Loading branch information
congqixia authored Feb 7, 2025
1 parent d7c07d1 commit 0bac4d3
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions client/milvusclient/read_options.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ func NewAnnRequest(annField string, limit int, vectors ...entity.Vector) *annReq
annField: annField,
vectors: vectors,
topK: limit,
searchParam: make(map[string]string),
templateParams: make(map[string]any),
}
}
Expand Down Expand Up @@ -358,12 +359,7 @@ func (opt *searchOption) WithSearchParam(key, value string) *searchOption {

func NewSearchOption(collectionName string, limit int, vectors []entity.Vector) *searchOption {
return &searchOption{
annRequest: &annRequest{
vectors: vectors,
searchParam: make(map[string]string),
topK: limit,
templateParams: make(map[string]any),
},
annRequest: NewAnnRequest("", limit, vectors...),
collectionName: collectionName,
useDefaultConsistencyLevel: true,
consistencyLevel: entity.ClBounded,
Expand Down

0 comments on commit 0bac4d3

Please sign in to comment.