Skip to content

Commit

Permalink
change search_list
Browse files Browse the repository at this point in the history
  • Loading branch information
Geapefurit committed Feb 1, 2024
1 parent b0a4517 commit 3da01a7
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions nft-meta/pkg/milvusdb/crud.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,16 +96,15 @@ func (c *nftConllectionMGR) Query(ctx context.Context, iDs []int64) (map[int64][
}

// return []map[id]score
func (c *nftConllectionMGR) Search(ctx context.Context, nftVectors [][VectorDim]float32, limit int) ([]map[int64]float32, error) {
func (c *nftConllectionMGR) Search(ctx context.Context, nftVectors [][VectorDim]float32, topK int) ([]map[int64]float32, error) {
ret := make([]map[int64]float32, 0)

cli, err := Client(ctx)
if err != nil {
return ret, err
}

var searchList = 100
sParam, err := entity.NewIndexDISKANNSearchParam(searchList)
sParam, err := entity.NewIndexDISKANNSearchParam(topK)
if err != nil {
return ret, err
}
Expand All @@ -116,7 +115,7 @@ func (c *nftConllectionMGR) Search(ctx context.Context, nftVectors [][VectorDim]
}

sRet, err := cli.Search(ctx, c.CollectionName, []string{DefaultPartition}, "", []string{FieldsID}, vec,
FieldsVector, entity.L2, limit, sParam)
FieldsVector, entity.L2, topK, sParam)
if err != nil {
return ret, err
}
Expand Down

0 comments on commit 3da01a7

Please sign in to comment.