-
-
Notifications
You must be signed in to change notification settings - Fork 115
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
[BUG] Possibly unexpected behaviour, when using additional callback in search
#250
Comments
search
Ok I think I have found the issue. It seems to stem from here: When call back is passed, @matchish is there a reason why it is done this way, or is this a bug? If the latter, im happy to make a pull request |
Hey) feel free to open the pr. But it breaking changes so probably I'll wait until will be merged to master. For now could be solved by calling toArray in callback I think |
@matchish yes, calling |
Any updates on this? |
Where exactly do you use this callback toArray? |
Describe the bug
Search breaks when you use callback.
Example: when you I use like this:
Everything is ok. But when you use search with additional callback, like so:
I get the following error:
Matchish\ScoutElasticSearch\ElasticSearch\EloquentHitsIteratorAggregate::__construct(): Argument #1 ($results) must be of type array, Elastic\Elasticsearch\Response\Elasticsearch given
To Reproduce
I think bug description is clear enough about how to reproduce
Expected behavior
In both cases it should return a collection with appropriate models
Additional context
Is it possible that I am trying to do this the wrong way?
Version
Versions of Laravel, Scout, and the package.
"matchish/laravel-scout-elasticsearch": "^6.0.2",
Laravel Framework 10.2.0
The text was updated successfully, but these errors were encountered: