Skip to content

Implement POST route in search method #131

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

Merged

Conversation

eskombro
Copy link
Member

Use POST route instead of GET for search method

Note: attributesToHighlight, attributesToRetrieve and attributesToCrop must always be a list (array) instead of a string so it is properly deserialized by the server

Closes #126

@eskombro eskombro self-assigned this Jul 20, 2020
@eskombro eskombro force-pushed the implement_post_route_in_search_method branch 2 times, most recently from fc787ea to f3de7db Compare July 20, 2020 00:52
@eskombro eskombro requested review from curquiza and bidoubiwa July 20, 2020 00:55
@eskombro eskombro changed the base branch from master to meilisearch-bump-v0.13.0 July 20, 2020 01:00
'attributesToHighlight': '*',
'attributesToRetrieve': '*',
'attributesToCrop': '*',
'attributesToHighlight': ['*'],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hum! These kinds of changes are breakable, right?

Copy link
Member

@curquiza curquiza left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wondering if this PR is breakable (not a big deal as usual 😉)

@@ -60,9 +60,9 @@ def test_custom_search_params_with_wildcard(self):
'a',
{
'limit': 5,
'attributesToHighlight': '*',
'attributesToRetrieve': '*',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The simple string "*" is not a valid entry ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It isn't for the post route. Do you think that's a core problem? A simple srting will creat a bad_request response

if key in ('facetsDistribution', 'facetFilters'):
opt_params[key] = json.dumps(opt_params[key])
elif isinstance(opt_params[key], list):
opt_params[key] = ','.join(opt_params[key])
params = {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
params = {
body = {
Suggested change
params = {
data = {

Just better naming because those are not params anymore. But It's up to you if you want to change it.

@eskombro eskombro force-pushed the implement_post_route_in_search_method branch from f3de7db to 9cd8b4b Compare July 20, 2020 09:12
@curquiza curquiza added the breaking-change The related changes are breaking for the users label Jul 20, 2020
@curquiza
Copy link
Member

Maybe wait for the meilisearch/meilisearch#866 final decision?

@eskombro
Copy link
Member Author

Maybe wait for the meilisearch/MeiliSearch#866 final decision?

Exactly, I opened that Issue and not planning to merge untill we get more info :) Thanks @curquiza !

@curquiza curquiza marked this pull request as draft July 21, 2020 08:05
@curquiza
Copy link
Member

Okay, I convert it to draft since we must not merge it 🙂

@eskombro eskombro marked this pull request as ready for review July 21, 2020 14:56
@eskombro eskombro merged commit c2585f3 into meilisearch-bump-v0.13.0 Jul 21, 2020
@eskombro eskombro deleted the implement_post_route_in_search_method branch July 21, 2020 14:56
curquiza pushed a commit that referenced this pull request Aug 3, 2020
Implement POST route in search method
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking-change The related changes are breaking for the users
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement POST route in search method
3 participants