Skip to content

Commit

Permalink
added params field to knn query parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
metonymic-smokey committed Sep 11, 2024
1 parent 0853b9d commit 5a9c121
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions search_knn.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ func (r *SearchRequest) UnmarshalJSON(input []byte) error {
VectorBase64 string `json:"vector_base64"`
K int64 `json:"k"`
Boost *query.Boost `json:"boost,omitempty"`
Params json.RawMessage `json:"params"`
FilterQuery json.RawMessage `JSON:"filter,omitempty"`
}

Expand Down Expand Up @@ -196,6 +197,7 @@ func (r *SearchRequest) UnmarshalJSON(input []byte) error {
r.KNN[i].VectorBase64 = temp.KNN[i].VectorBase64
r.KNN[i].K = temp.KNN[i].K
r.KNN[i].Boost = temp.KNN[i].Boost
r.KNN[i].Params = temp.KNN[i].Params
if len(knnReq.FilterQuery) == 0 {
// Setting this to nil to avoid ParseQuery() setting it to a match none
r.KNN[i].FilterQuery = nil
Expand Down

0 comments on commit 5a9c121

Please sign in to comment.