-
Notifications
You must be signed in to change notification settings - Fork 39
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
Pagination not working properly when using query callback #30
Comments
We are also experiencing this issue on our team. The original issue explains the issue exactly so I don't feel a real need to add on details of our particular scenario. However, I did dig into the source code of Laravel Scout and the Scout Typesense driver here and discovered the root of the problem (although I have not figured out an actual fix yet). The base Laravel Scout
(https://github.com/laravel/scout/blob/9.x/src/Builder.php#L451-L453) This code sets the I will likely be working on a fork/fix/PR in the next few days, but I wanted to go ahead and document my findings here in case any other poor souls out in the world run into this issue. One last thing I'd like to point out is that it is unclear to me whether this is a flaw with this package or with the |
Same issue here! @nickrupert7 Hit me up if you can use any support/testing on this. |
@RightInTwo thanks, will do! I got pulled into other projects so my progress here is delayed, but I'll post an update when I finally get around to it. |
We've implemented a solution based on SQL Views that include the $relations with the joinRelations package. So this issue is not blocking us anymore... |
Hi @nickrupert7, do you have a workaround? i was hit by this issue. |
This is an old issue and has not been fixed. This issue is reported everywhere with no resolution @nickrupert7 @RightInTwo @devaygun |
Description
It seems the TypesenseEngine doesn't correctly work with Scout's
->paginate
, particularly when results exceeed 250 hits, as the total in the pagination gets set to the defaultperPage
for some reason. It seems the MeiliSearch adapter also had this issue, see: laravel/scout#535The workaround I have is to implement the pagination manually with:
Steps to reproduce
Expected Behavior
Return a LengthAwarePaginator with 1278 total items.
Actual Behavior
Returns a LengthAwarePaginator with 15 total items.
Metadata
Typsense Version: v5.1.0-rc1
OS: MacOS 12.4 Monterey
Raw results from Typesense:
Pagination without query callback works as expected:
Pagination with query callback does NOT work as expected:
The text was updated successfully, but these errors were encountered: