Plan to use `ruflin/elastica` version 8?
jmariller opened this issue ยท 28 comments
Hi,
First of all thank you for this library :-)
I am wondering if it is planned to use version 8 of ruflin/elastica
, and if so when more or less?
Many thanks
We would be happy to see Pull Request about this yes. Can you work on this?
Some difficulties could arise:
- the connections pool is now based on Elasticsearch custom https://github.com/elastic/elastic-transport-php - so our Symfony HttpClient bridge must probably be changed;
- it will probably stop working with OpenSearch, see elastic/elasticsearch-php#1347 (not tested)
I would love for our project to be compatible with both 7 and 8.
Thank you @damienalexandre for your quick feedback! Sure I can invest some time to try & contribute ๐
also I forgot to mention that I am not sure if we can make it work with both versions, as the namespace for different classes (e.g. Client
) has changed between 7 and 8.
The 8.0.0 version is now released https://github.com/ruflin/Elastica/releases/tag/8.0.0
Thanks @VincentLanglet for the update!
@damienalexandre so I started to work on it and now I get following error message for many of the PhpUnit tests:
Elastic\Transport\Exception\NoNodeAvailableException: Exceeded maximum number of retries (1)
I am missing anything, should I set some environment/configuration value?
The tests are running against a real Elasticsearch.
You can run this:
make start
make test
make stop
It will boot a ES node via Docker and expose port 9999 (we don't use the default 9200 port to avoid touching any real Elasticsearch node you may have on your computer).
I had actually tried to start the docker ES node as I saw the makefile, however I still get exactly the same error message ๐ any other idea?
hi @damienalexandre so I tried once again to make this work without success, would you have any other hint?
Could you show the console output?
Can you run docker ps
?
Can you open http://127.0.0.1:9999/ in a browser?
What does curl http://127.0.0.1:9999/
get you?
I don't know what's happening but:
- you have a working php
- you have a working elasticsearch
Is there something we don't know? Do you have a proxy?
Can you go to http://127.0.0.1:9999/_cluster/health?pretty and paste the result?
Thanks for taking the time to help ๐
Here is the outcome of that URL:
{
"cluster_name": "docker-cluster",
"status": "green",
"timed_out": false,
"number_of_nodes": 1,
"number_of_data_nodes": 1,
"active_primary_shards": 0,
"active_shards": 0,
"relocating_shards": 0,
"initializing_shards": 0,
"unassigned_shards": 0,
"delayed_unassigned_shards": 0,
"number_of_pending_tasks": 0,
"number_of_in_flight_fetch": 0,
"task_max_waiting_in_queue_millis": 0,
"active_shards_percent_as_number": 100
}
Status green, it should work!
You test from "master" or with your updated dependencies? It looks like the Elastica client is not properly configured, that may be a regression from version 8.
aaah got it, it is indeed an issue from version 8! I reverted my changes and it works fine ๐ alright then, I need to investigate further ๐ thanks again so much for your support ๐
ps: if anyone sees this and wants to help too, please do ๐
FYI elastic/elasticsearch-php
8.0 is no more compatible with alternative servers like opensearch
.
There is a mechanism that checks the headers elastic/elasticsearch-php#1229
thanks @jderusse I have actually also just noticed the same while trying to run the tests with elasticsearch
without updating the docker image ๐
@damienalexandre I am making some progress, now some more tests are green ๐
short update, now I have all tests green besides the one for the HttpClientTransport
where I might need some help - I'll do as much as I can ๐