Skip to content

Commit

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

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

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

⚠️ This PR should NOT be merged until the next release of Meilisearch (v1.11.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: Clémentine <[email protected]>
Co-authored-by: Clément Renault <[email protected]>
Co-authored-by: curquiza <[email protected]>
  • Loading branch information
4 people authored Oct 28, 2024
2 parents 4f9f232 + 4310831 commit db59921
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 19 deletions.
3 changes: 2 additions & 1 deletion .code-samples.meilisearch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -895,6 +895,7 @@ get_similar_post_1: |-
resp := new(meilisearch.SimilarDocumentResult)
client.Index("INDEX_NAME").SearchSimilarDocuments(&meilisearch.SimilarDocumentQuery{
Id: "TARGET_DOCUMENT_ID",
Embedder: "default",
}, resp)
search_parameter_reference_ranking_score_threshold_1: |-
client.Index("INDEX_NAME").Search("badman", &meilisearch.SearchRequest{
Expand Down Expand Up @@ -940,7 +941,7 @@ update_proximity_precision_settings_1: |-
reset_proximity_precision_settings_1: |-
client.Index("books").ResetProximityPrecision()
search_parameter_reference_locales_1: |-
client.index("INDEX_NAME").Search("進撃の巨人", &meilisearch.SearchRequest{
client.index("INDEX_NAME").Search("QUERY TEXT IN JAPANESE", &meilisearch.SearchRequest{
Locates: []string{"jpn"}
})
get_localized_attribute_settings_1: |-
Expand Down
18 changes: 4 additions & 14 deletions index_search_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1943,19 +1943,6 @@ func TestIndex_SearchWithVectorStore(t *testing.T) {
RetrieveVectors: true,
},
},
{
name: "empty Embedder",
UID: "indexUID",
client: sv,
query: "Pride and Prejudice",
request: SearchRequest{
Hybrid: &SearchRequestHybrid{
SemanticRatio: 0.5,
Embedder: "",
},
RetrieveVectors: true,
},
},
}

for _, tt := range tests {
Expand Down Expand Up @@ -2029,14 +2016,17 @@ func TestIndex_SearchSimilarDocuments(t *testing.T) {
client: sv,
request: &SimilarDocumentQuery{
Id: "123",
Embedder: "default",
},
resp: new(SimilarDocumentResult),
wantErr: false,
},
{
UID: "indexUID",
client: sv,
request: &SimilarDocumentQuery{},
request: &SimilarDocumentQuery{
Embedder: "default",
},
resp: new(SimilarDocumentResult),
wantErr: true,
},
Expand Down
2 changes: 1 addition & 1 deletion index_settings_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3422,7 +3422,7 @@ func TestIndex_UpdateSettingsEmbedders(t *testing.T) {
"default": {
Source: "openAi",
ApiKey: "xxx",
Model: "text-embedding-ada-002",
Model: "text-embedding-3-small",
DocumentTemplate: "A movie titled '{{doc.title}}'",
},
},
Expand Down
6 changes: 3 additions & 3 deletions types.go
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ type SearchRequest struct {
IndexUID string `json:"indexUid,omitempty"`
Query string `json:"q"`
Distinct string `json:"distinct,omitempty"`
Hybrid *SearchRequestHybrid `json:"hybrid,omitempty"`
Hybrid *SearchRequestHybrid `json:"hybrid"`
RetrieveVectors bool `json:"retrieveVectors,omitempty"`
RankingScoreThreshold float64 `json:"rankingScoreThreshold,omitempty"`
FederationOptions *SearchFederationOptions `json:"federationOptions,omitempty"`
Expand All @@ -446,7 +446,7 @@ type SearchFederationOptions struct {

type SearchRequestHybrid struct {
SemanticRatio float64 `json:"semanticRatio,omitempty"`
Embedder string `json:"embedder,omitempty"`
Embedder string `json:"embedder"`
}

type MultiSearchRequest struct {
Expand Down Expand Up @@ -517,7 +517,7 @@ type DocumentsQuery struct {
// SimilarDocumentQuery is query parameters of similar documents
type SimilarDocumentQuery struct {
Id interface{} `json:"id,omitempty"`
Embedder string `json:"embedder,omitempty"`
Embedder string `json:"embedder"`
AttributesToRetrieve []string `json:"attributesToRetrieve,omitempty"`
Offset int64 `json:"offset,omitempty"`
Limit int64 `json:"limit,omitempty"`
Expand Down

0 comments on commit db59921

Please sign in to comment.