-
Notifications
You must be signed in to change notification settings - Fork 49
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
Fix synonyms pagination #34
base: master
Are you sure you want to change the base?
Fix synonyms pagination #34
Conversation
We are removing params sanitization since Algolia already validates it. With that we can keep the lib as thin as possible and as close as possible with the documentation.
{:ok, %{"hits" => hits, "nbPages" => pages}} when page + 1 < pages -> | ||
page_hits(hits) | ||
|
||
{:ok, %{"hits" => hits, "nbHits" => nbHits}} when page + 1 < nbHits / hits_per_page -> |
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.
Is this an edge case when Algolia doesn't return nbPages
in their response JSON?
* - `consequence` Required at least 1 [consequence](https://www.algolia.com/doc/api-reference/api-methods/save-rule/?language=javascript#method-param-consequence-2) | ||
* -- `params`: Additional search parameters. Any valid search parameter is allowed. | ||
* -- `promote`: List with objects to promote as hits. | ||
* --- `objectID` |
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.
This is pretty cool. How does it look like in ex_doc
's output?
Hi @sikanhe 👋 - can you help us in the review of this PR, please? 🙂 |
Hi I am looking for a new owner/maintainer. I have not used Elixir in over three years |
Hi @sikanhe - Thanks for your answer |
This PR fixes a bug in the pagination of the synonyms list returned by synonyms/search endpoint.
This endpoint only returns the total number of hits instead of the number of pages
It also incorporates the changes from previous PR.
Note: The query rule is a paid feature, and since I don't have a paid personal key I also opened the PR as draft to run the test suite.