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
However once I add this empty callback query, the results drop from ~22k to 48 (the pagination number) and there's no next page/page numbers shown:
->query(function ($query) {})
Query wise, nothing has changed. My initial goal was to eager load a relation to pull one column in to the hydrated returned models but found out even just adding an empty query callback causes the total results to drop significantly
Steps To Reproduce
Install Laravel Scout, Typesense
Setup model with thousands of records and import with Scout
Setup model relation
Use query above using code to re-test
The text was updated successfully, but these errors were encountered:
Looking deeper into things it looks like the cause is the Scout 'Builder' class specifically line 499 down in the 'getTotalCount' method. If we return '$totalCount' and remove the is null check on query callback it shows the right number of total results.
As Laravel is an open source project, we rely on the community to help us diagnose and fix issues as it is not possible to research and fix every issue reported to us via GitHub.
If possible, please make a pull request fixing the issue you have described, along with corresponding tests. All pull requests are promptly reviewed by the Laravel team.
Scout Version
10.11.2
Scout Driver
Typesense
Laravel Version
10.48.2
PHP Version
8.2.23
Database Driver & Version
No response
SDK Version
No response
Meilisearch CLI Version
No response
Description
There's another issue with v10.11.2 I've noticed in #865 but this issue does appear in both v10.11.2 and v10.11.3 (I haven't tested older versions)
The above returns ~22k results for me locally
However once I add this empty callback query, the results drop from ~22k to 48 (the pagination number) and there's no next page/page numbers shown:
Query wise, nothing has changed. My initial goal was to eager load a relation to pull one column in to the hydrated returned models but found out even just adding an empty query callback causes the total results to drop significantly
Steps To Reproduce
The text was updated successfully, but these errors were encountered: