Skip to content

Commit

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

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

This PR:
- gathers the changes related to the next Meilisearch release (v1.6.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.6.0 is out.

⚠️ This PR should NOT be merged until the next release of Meilisearch (v1.6.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 <[email protected]>
Co-authored-by: curquiza <[email protected]>
Co-authored-by: Clémentine U. - curqui <[email protected]>
  • Loading branch information
3 people authored Jan 15, 2024
2 parents 0b52e5e + e231ddb commit 503303e
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 30 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,8 @@ searchRes, err := index.Search("wonder",

This package guarantees compatibility with [version v1.x of Meilisearch](https://github.com/meilisearch/meilisearch/releases/latest), but some features may not be present. Please check the [issues](https://github.com/meilisearch/meilisearch-go/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22+label%3Aenhancement) for more info.

⚠️ This package is not compatible with the [`vectoreStore` experimental feature](https://www.meilisearch.com/docs/learn/experimental/vector_search) of Meilisearch v1.6.0 and later. More information on this [issue](https://github.com/meilisearch/meilisearch-go/issues/504).

## 💡 Learn more

The following sections in our main documentation website may interest you:
Expand Down
61 changes: 31 additions & 30 deletions index_search_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1600,38 +1600,39 @@ func TestIndex_SearchWithShowRankingScore(t *testing.T) {
require.NotNil(t, got.Hits[0].(map[string]interface{})["_rankingScore"])
}

func TestIndex_SearchWithVectorStore(t *testing.T) {
type args struct {
UID string
PrimaryKey string
client *Client
query string
request SearchRequest
}
testArg := args{
UID: "indexUID",
client: defaultClient,
query: "Pride and Prejudice",
request: SearchRequest{
Vector: []float64{0.1, 0.2, 0.3},
},
}
// Commented because of https://github.com/meilisearch/meilisearch-go/issues/504
// func TestIndex_SearchWithVectorStore(t *testing.T) {
// type args struct {
// UID string
// PrimaryKey string
// client *Client
// query string
// request SearchRequest
// }
// testArg := args{
// UID: "indexUID",
// client: defaultClient,
// query: "Pride and Prejudice",
// request: SearchRequest{
// Vector: []float64{0.1, 0.2, 0.3},
// },
// }

i, err := SetUpIndexWithVector(testArg.UID)
if err != nil {
t.Fatal(err)
}
// i, err := SetUpIndexWithVector(testArg.UID)
// if err != nil {
// t.Fatal(err)
// }

c := testArg.client
t.Cleanup(cleanup(c))
// c := testArg.client
// t.Cleanup(cleanup(c))

got, err := i.Search(testArg.query, &testArg.request)
require.NoError(t, err)
require.NotNil(t, got.Hits[0].(map[string]interface{})["_vectors"])
// got, err := i.Search(testArg.query, &testArg.request)
// require.NoError(t, err)
// require.NotNil(t, got.Hits[0].(map[string]interface{})["_vectors"])

vectorsRes := got.Hits[0].(map[string]interface{})["_vectors"].([]interface{})
// vectorsRes := got.Hits[0].(map[string]interface{})["_vectors"].([]interface{})

for i := range vectorsRes {
require.Equal(t, testArg.request.Vector[i], vectorsRes[i])
}
}
// for i := range vectorsRes {
// require.Equal(t, testArg.request.Vector[i], vectorsRes[i])
// }
// }

0 comments on commit 503303e

Please sign in to comment.