-
-
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] PHP 8.1 EloquentHitsIteratorAggregate TypeError #215
Comments
php version? packages versions? scout, elasticsearch client |
PHP 8.1, ElasticSearch 8.3.3, laravel-scout-es V6.0.2, laravel/framework v9.25.1, laravel/scout v9.4.10 |
@matchish We are facing the same problem. |
@amjadbanimattar @sfdjo435 Could you provide a sample custom search to test locally? |
I think it is related to changes about the Elasticsearch search response. Older version was returning array but the new version is returning Response object. So, for the custom search |
This is a sample with an error :
Here the error :
I think this is what we are looking for. So the quick solution for this error is using
I think the solution is that we need to force the users to return a specific type for the callback to be sure the returned data for |
There is another question. Why tests passes. Should fail as I understand |
Here, in our library, we expect an array response from |
On the other hand, we had flaged |
So in ci we don't use last elasticsearch lib? |
I think it will be enough to update readme with your quick solution. |
I think so. the callback return needs to be an array. We need to mention that this is a BC Break of latest version. |
When using a custom search method:
function (Client $client, Search $search)
you'll get a TypeError:The text was updated successfully, but these errors were encountered: