You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix Typesense pagination issue when using query callback (#867)
* fix(typesense): fix per_page error when paginating with query callbacks
- Implement performPaginatedSearch for large result sets
- Add maxTotalResults property to limit total fetched results
- Adjust search method to use maxPerPage as default limit
- Ensure search respects both maxPerPage and maxTotalResults limits
This ensures that when the `getTotalCount` builder function is called
with a query callback, the resulting request to the server will be
broken down batches of 250 results per page, Typesense's maximum.
* feat(typesense): addmax total results configuration for typesense
- Introduce a new 'max_total_results' configuration option for Typesense
in scout.php.
- Update TypesenseEngine constructor and EngineManager to
utilize this new parameter, providing better control over the maximum
number of searchable results.
This ensures that the resulting requests to the server when broken up to
batches are handled by the user, not defaulting to Typesense's total
records, as that can introduce perfomance issues for larger datasets.
* test(typesense): add test for paginated search with empty query callback
- Implement new test method in TypesenseSearchableTest to verify
pagination behavior with an empty query callback.
This ensures the search functionality works correctly when
no additional query constraints are applied.
* style: ci linting errors
* fix(test): fix missing constructor args in typesense unit test
* style: more ci linting errors
* formatting
* formatting
---------
Co-authored-by: Taylor Otwell <taylor@laravel.com>
0 commit comments