laravel / scout

Laravel Scout provides a driver based solution to searching your Eloquent models.
https://laravel.com/docs/scout
MIT License
1.57k stars 336 forks source link

[Typesense] Fix Paginate Function Returning Limited Records in Laravel Scout with Typesense Engine (#824) #858

Closed tharropoulos closed 2 months ago

tharropoulos commented 3 months ago

This pull request addresses an issue where the paginate function in Laravel Scout with the Typesense engine always returns a number of records limited to the perPage value, rather than reflecting the actual total number of matches from the Typesense server. This behavior was traced back to the limit attribute being set to the perPage value, which restricted the number of records returned. (#824)

Changes Made:

Rationale:

The current behavior prevents users from receiving all the results they expect based on the actual total number of matches on the Typesense server. By removing the forced assignment of the perPage value to the limit attribute, we allow the pagination to work correctly, returning the correct number of records.