mirror of
https://gitee.com/milvus-io/milvus.git
synced 2025-12-07 01:28:27 +08:00
fix: [GoSDK] Unify AnnRequest creation and fix nil map (#39665)
Related to #39559 Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
This commit is contained in:
parent
d7c07d16d3
commit
0bac4d3f2a
@ -85,6 +85,7 @@ func NewAnnRequest(annField string, limit int, vectors ...entity.Vector) *annReq
|
|||||||
annField: annField,
|
annField: annField,
|
||||||
vectors: vectors,
|
vectors: vectors,
|
||||||
topK: limit,
|
topK: limit,
|
||||||
|
searchParam: make(map[string]string),
|
||||||
templateParams: make(map[string]any),
|
templateParams: make(map[string]any),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -358,12 +359,7 @@ func (opt *searchOption) WithSearchParam(key, value string) *searchOption {
|
|||||||
|
|
||||||
func NewSearchOption(collectionName string, limit int, vectors []entity.Vector) *searchOption {
|
func NewSearchOption(collectionName string, limit int, vectors []entity.Vector) *searchOption {
|
||||||
return &searchOption{
|
return &searchOption{
|
||||||
annRequest: &annRequest{
|
annRequest: NewAnnRequest("", limit, vectors...),
|
||||||
vectors: vectors,
|
|
||||||
searchParam: make(map[string]string),
|
|
||||||
topK: limit,
|
|
||||||
templateParams: make(map[string]any),
|
|
||||||
},
|
|
||||||
collectionName: collectionName,
|
collectionName: collectionName,
|
||||||
useDefaultConsistencyLevel: true,
|
useDefaultConsistencyLevel: true,
|
||||||
consistencyLevel: entity.ClBounded,
|
consistencyLevel: entity.ClBounded,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user