laravel/scout

Scout always returning an empty response but paginateRaw returns data

seunsekoni opened this issue · 5 comments

Scout Version

10.5.0

Scout Driver

Meilisearch

Laravel Version

10.33.0

PHP Version

8.2.0

Database Driver & Version

No response

SDK Version

1.5

Meilisearch CLI Version

No response

Description

I recently upgraded the Laravel version (v10.33) of my project to use scout's latest package (v10.5). But it seems like what used to work doesn't work anymore.

Typically, when I write
Business::search(query: $query)->get(), I get results (this was before the upgrade). Since my upgrade, something weird happens. It doesn't return any result anymore. I get an empty collection. Sample dd()
Illuminate\Database\Eloquent\Collection { #items: [] #escapeWhenCastingToString: false }
I have also tried downgrading but no luck.

I have checked the indexing and yes, all the data are being indexed on meilisearch.
However, when I use paginateRaw(), it returns data in a paginated result . But this isn't my use case. I need the full result in a collection

Steps To Reproduce

Model::search(query: $query)->get()

Hey there, thanks for reporting this issue.

We'll need more info and/or code to debug this further. Can you please create a repository with the command below, commit the code that reproduces the issue as one separate commit on the main/master branch and share the repository here?

Please make sure that you have the latest version of the Laravel installer in order to run this command. Please also make sure you have both Git & the GitHub CLI tool properly set up.

laravel new bug-report --github="--public"

Do not amend and create a separate commit with your custom changes. After you've posted the repository, we'll try to reproduce the issue.

Thanks!

Hi there,

I have done as requested. Repo url is https://github.com/seunsekoni/bug-report

Thanks for taking the time to look at it 🙏

Please provide the Meilisearch CLI version information.

Also, there are no database migration and seeding for the example Business class, this is not a complete reproducing repository: seunsekoni/bug-report@f37854d

Sorry but I'm unable to replicate the issue, please submit an issue with reproducing code that represents the issue for us to debug this.