Skip to content

Commit

Permalink
Merge #535
Browse files Browse the repository at this point in the history
535: Changes related to the next Meilisearch release (v1.9.0) r=curquiza a=meili-bot

Related to this issue: meilisearch/integration-guides#301

This PR:
- gathers the changes related to the next Meilisearch release (v1.9.0) so that this package is ready when the official release is out.
- should pass the tests against the [latest pre-release of Meilisearch](https://github.com/meilisearch/meilisearch/releases).
- might eventually contain test failures until the Meilisearch v1.9.0 is out.

⚠️ This PR should NOT be merged until the next release of Meilisearch (v1.9.0) is out.

_This PR is auto-generated for the [pre-release week](https://github.com/meilisearch/integration-guides/blob/main/resources/pre-release-week.md) purpose._


Co-authored-by: meili-bot <74670311+meili-bot@users.noreply.github.com>
Co-authored-by: curquiza <clementine@meilisearch.com>
  • Loading branch information
3 people authored Jul 1, 2024
2 parents 0131c58 + 6aa0623 commit 688ce36
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 6 deletions.
3 changes: 3 additions & 0 deletions index_search.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,9 @@ func searchPostRequestParams(query string, request *SearchRequest) map[string]in
hybrid["semanticRatio"] = request.Hybrid.SemanticRatio
params["hybrid"] = hybrid
}
if request.RetrieveVectors {
params["retrieveVectors"] = request.RetrieveVectors
}

return params
}
7 changes: 1 addition & 6 deletions index_search_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1638,11 +1638,11 @@ func TestIndex_SearchWithVectorStore(t *testing.T) {
client: defaultClient,
query: "Pride and Prejudice",
request: SearchRequest{
Vector: []float32{0.1, 0.2, 0.3},
Hybrid: &SearchRequestHybrid{
SemanticRatio: 0.5,
Embedder: "default",
},
RetrieveVectors: true,
},
}

Expand All @@ -1660,10 +1660,5 @@ func TestIndex_SearchWithVectorStore(t *testing.T) {
for _, hit := range got.Hits {
hit := hit.(map[string]interface{})
require.NotNil(t, hit["_vectors"])
vectors := hit["_vectors"].(map[string]interface{})

require.NotNil(t, vectors["default"])
def := vectors["default"].([]interface{})
require.Equal(t, 3, len(def))
}
}
1 change: 1 addition & 0 deletions types.go
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,7 @@ type SearchRequest struct {
IndexUID string
Query string
Hybrid *SearchRequestHybrid
RetrieveVectors bool
}

type SearchRequestHybrid struct {
Expand Down
7 changes: 7 additions & 0 deletions types_easyjson.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 688ce36

Please sign in to comment.