Skip to content

Conversation

@bidoubiwa
Copy link
Contributor

We would like users to be able to test out our new way to handle pagination before adding it to Meilisearch.

While previously if the user wanted to have a pagination with page number (Ex: << < 1, 2, 3, ... > >>) they had to use finitePagination:true and paginationTotalHits.

These have been removed as Meilisearch now handles this type of pagination.

The following parameters in the instantMeiliSearch client are removed:

  • finitePagination
  • paginationTotalHits

See related issue
See related discussion

@bidoubiwa bidoubiwa added the breaking-change The related changes are breaking for the users label Jul 20, 2022
@bidoubiwa bidoubiwa added the beta Changes not meant to be merged on main label Jul 25, 2022
@bidoubiwa bidoubiwa requested a review from brunoocasali July 26, 2022 07:55
@bidoubiwa bidoubiwa requested a review from mdubus August 1, 2022 11:49
} else if (totalHits !== undefined) {
return totalHits
}
return hitsPerPage * totalPages
Copy link
Member

Choose a reason for hiding this comment

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

According to our internal conversation, this will change in the future, right @bidoubiwa ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

According to our internal conversation, this will change in the future,

What do you mean?

Copy link
Member

Choose a reason for hiding this comment

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

The idea here is that the core team provides a real number of hits we have. Because even we doing a math here we cannot be 100% sure since we may have pages without the whole limit.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Its the if just above

else if (totalHits !== undefined) {
    return totalHits
  }

Thats the hit Meilisearch returns. The return is a safe guard in case total hits is missing but it should indeed not happen so I could as well remove it

@bidoubiwa
Copy link
Contributor Author

It has been implemented in #878 and released :)

@bidoubiwa bidoubiwa closed this Dec 7, 2022
@brunoocasali brunoocasali deleted the pagination-beta branch December 12, 2022 16:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

beta Changes not meant to be merged on main breaking-change The related changes are breaking for the users

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants