matchish / laravel-scout-elasticsearch

Search among multiple models with ElasticSearch and Laravel Scout
MIT License
702 stars 113 forks source link

[BUG] Class Elasticsearch\Client not found #258

Closed soeurngsar closed 9 months ago

soeurngsar commented 1 year ago

Describe the bug In Laravel v10.x I'm upgrade laravel-scout-elasticsearch to v7.3 as you mention that it is support Laravel Scout v10.x as well. After composer update and I make a test to query from Elastic it show the error Class Elasticsearch\Client not found.

As I check on your source code it is required elasticsearch-php v8.x and elasticsearch-php has changed the name space from Elasticsearch to Elastic\Elasticsearch which make your code not working.

To Reproduce Steps to reproduce the behavior: $client = app()->make(Client::class); $data = $client->msearch($params);

Expected behavior It should get the result from ElasticSearch.

Additional context I'm using msearch from ElasticSearch.

Version Laravel version 10.x, Scout version 10.x

hkulekci commented 11 months ago

I could not reproduce this error. Could you share the complete trace of the error? It should be related to ES upgrade, not scout upgrade, and according to tests, I am not expecting this error. If you can share a full trace, we can try to find the real problem.

hkulekci commented 10 months ago

Hey @soeurngsar, do you have any update on this issue?

soeurngsar commented 9 months ago

Hi @hkulekci , Thank for your feedback. I found that this issue has been resolved for some reason.