-
Notifications
You must be signed in to change notification settings - Fork 87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add typo tolerance settings #294
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have some comments, since this is one of my "first" GoLang reviews :)
endpoint: "/indexes/" + i.UID + "/settings/typo-tolerance", | ||
method: http.MethodPost, | ||
contentType: contentTypeJSON, | ||
withRequest: &request, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you enlighten me on this one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Object
doesn't really exist in go, so to send multiple arguments it's easier to use struct. For this purpose, we create this struct with all data we need to process a request:
type internalRequest struct {
endpoint string
method string
contentType string
withRequest interface{}
withResponse interface{}
withQueryParams map[string]string
acceptedStatusCodes []int
functionName string
}
We send the struct to the eexecuteRequestfunction with all the data needed, and a
interface{}in
withRequest` who will be fill with the response from the API.
@@ -1222,6 +1320,15 @@ func TestIndex_UpdateSettings(t *testing.T) { | |||
SortableAttributes: []string{ | |||
"title", | |||
}, | |||
TypoTolerance: &TypoTolerance{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you need to check in every assertion if the object is equal to another object? What do you think about making the assertions with the part you need?
I saw a lot of changed tests with TypoTolerance
stuff which did not concern them!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand what you mean. Can you explain a little more?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, but I think the answer will be "the tests are autogenerated" haha.
What I mean is, if in the test "update typo tolerance using settings" we just update one field, we don't need to assert every other field, just we want to be changed.
286: Changes related to the next Meilisearch release (v0.27.0) r=curquiza a=meili-bot Related to this issue: meilisearch/integration-guides#190 This PR: - gathers the changes related to the next Meilisearch release (v0.27.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 v0.27.0 is out.⚠️ This PR should NOT be merged until the next release of Meilisearch (v0.27.0) is out. _This PR is auto-generated for the [pre-release week](https://github.com/meilisearch/integration-guides/blob/master/guides/pre-release-week.md) purpose._ Done: - #287 - #289 - #290 - #291 - #294 - #293 # Release **:warning:** The go package didn't need a version update CI will publish the package once the `Publish release` will be done. However, a version file exists and this is only for analytics but it already is on the next version (the v0.19.1). This version makes this package compatible with MeiliSearch v0.27.0🎉 Check out the changelog of [MeiliSearch v0.27.0](https://github.com/meilisearch/MeiliSearch/releases/tag/v0.27.0) for more information about the changes. ## 🚀 Enhancements * Feature/Analytics (#279) `@brunoocasali` * Add new methods for the new typo tolerance settings #294 `@alallema` `Index.GetTypoTolerance()` `Index.UpdateTypoTolerance(params)` `Index.ResetTypoTolerance()` * Ensure nested field support #290 `@alallema` * Add new search parameters highlightPreTag, highlightPostTag and cropMarker #291 `@alallema` Co-authored-by: meili-bot <74670311+meili-bot@users.noreply.github.com> Co-authored-by: Amélie <alallema@users.noreply.github.com> Co-authored-by: alallema <amelie@meilisearch.com>
This PR introduces the new setting: typoTolerance
new methods:
Index.GetTypoTolerance()
Index.UpdateTypoTolerance(params)
Index.ResetTypoTolerance()
closed #288