Finally 8.0.0
for Elasticsearch 8.0 is GA!!! 🥳
This new major version of elasticsearch-php
contains a brand new implementation compared with 7.x. It supports PSR-7 for HTTP messages and PSR-18 for HTTP client communications. We used the elastic-transport-php library for HTTP communications.
We tried to reduce the BC breaks as much as possible with 7.x
but there are some (big) differences:
- we changed the namespace, now everything is under
Elastic\Elasticsearch
; - we changed the
Exception
model, using the namespaceElastic\Elasticsearch\Exception
. All the exceptions extends the
ElasticsearchException
interface, as in 7.x; - we changed the response type of each endpoints using an Elasticsearch response class.
This class wraps a a PSR-7 response allowing the access of the body response
as array or object. This means you can access the API response as in 7.x, no BC break here! 👼
You can have a look at the BREAKING_CHANGES file for more information.
We are still working on the new documentation for 8.0
, in the meantime you can have a look at the README where we reported a quick start guide.