-
Notifications
You must be signed in to change notification settings - Fork 44
paginateRaw() returns wrong amount of total items #131
Comments
I had already looked around a bit but I just found these two issues: Maybe you should consider to throw an error when the user tries to use |
Hello @jan-krueger! Sorry for the confusion and the issue! As you found out we are aware of this issue. We have just hired someone as a product owner who will help us improve this kind of feature and remove the confusion around the pagination in the future. thanks for your feedback 🙂 |
We are experiencing the same issue when attempting to use pagination together with a filter. The workaround works (take 1000 items, array_slice them) but doesn't feel optimal. It's also not supported by the default pagination in this package (or laravel/scout). Maybe the implementation can be fixed to use array_slice or another workaround when filters are present? Or is it expected that offset/limit will work as expected soon? |
If you mean soon like "next month", it will not. The core team is currently working hard on a huge refactor that might be released during the summer. Once this release is done, the pagination will be the first prioritization. So it will be improved by the end of the year 🙂 |
Uh oh!
There was an error while loading. Please reload this page.
Hello, first up, thank you for this package, but I run into an issue. I have a search interface, and the search itself looks like this:
I have in total 3 records in the database, so for testing purposes I set the amount of items per page to
2
.$options['fliters']
are applied it works perfectly.$options['fliters']
that is filled with something like e.g.category_id = 1
then it starts to break down. In this example, there are only two items that match this requirement yet when I select the first page, it thinks that there are 3 items in total resulting in two pages. When I go to the second page which causes another search request but with$data['page'] = 2
it "notices" that there is no second page, and then says that the total amount of items is2
. But at that point I am already displaying an empty page to the user.The issue also persists when I set the max items per page to 1. It will initially tell me that there are 3 pages available when I visit the first or second page but as soon as I go to the third, it returns no more items and then it also actually returns that there are only 2 in this category.
Do you have any idea what could cause this? I use Laravel 8.38. Scout 8.6.1, and meilisearch-laravel-scout 0.12.5.
The text was updated successfully, but these errors were encountered: