Skip to content
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

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

Merged
merged 1 commit into from
Sep 4, 2024

Conversation

tharropoulos
Copy link
Contributor

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:

  • Removed the assignment of the perPage value to the limit attribute in the TypesenseEngine class to allow the pagination to reflect the actual total number of matches.

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.

- Remove assignment of `perPage` to builder's limit attribute
- Allows for accurate total record count beyond `perPage` value
- Addresses interaction issue between `Builder` and `TypesenseEngine`
- Ensures correct limit setting for Typesense server queries
@taylorotwell taylorotwell merged commit 71502b1 into laravel:10.x Sep 4, 2024
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants