massiveart / MassiveSearchBundle

MIT License
67 stars 24 forks source link

Elasticsearch 8 compatibility #169

Open hacfi opened 1 year ago

hacfi commented 1 year ago

In version 8 of elasticsearch/elasticsearch the namespace changed from Elasticsearch to Elastic\Elasticsearch (https://github.com/elastic/elasticsearch-php/blob/main/BREAKING_CHANGES.md). Integrating this bundle into a Symfony 6 project I've noticed that there is no way to change massive_search.search.adapter.elastic.client.class (https://github.com/massiveart/MassiveSearchBundle/blob/2.8/Resources/config/adapter_elastic.xml#L7).

The issue is that in loads the adapter_elastic.xml before checking the existence of that class and loading the xml will always reset it: https://github.com/massiveart/MassiveSearchBundle/blob/2.8/DependencyInjection/MassiveSearchExtension.php#L79-L81