oMelhor.Net

Elasticsearch PHP client overview | PHP

Elasticsearch PHP client overview | PHP
The Elasticsearch PHP client is designed to be a low-level client. All methods closely match the REST API and the method structure of other language clients...

Resumido por Omeloton IA:

The Elasticsearch PHP client is a low-level client designed to be easy to use. It closely matches the REST API and other language client methods, making it easy to get started and switch between languages. The client provides a response-handling layer that allows you to access HTTP responses in different formats.

You can access them as a PHP array, object, or raw string. For more details, refer to the blog post for the Elasticsearch PHP client. The client also provides helpers to map ES|QL results directly to PHP objects. For more information, refer to the map php result to an object documentation.

The client allows you to make API calls and read the response in multiple formats: associative array, object, raw string, or PSR-7 response. For a step-by-step quickstart guide, refer to the Getting started guide. The Elasticsearch PHP client uses the PSR 7 standard, a community effort that defines interfaces for PHP Framework Interop Group.

For more information, refer to the PSR 7 standard documentation. The Elasticsearch PHP client is compatible with PHP versions currently maintained and supported. Elasticsearch language clients are forward compatible, ensuring compatibility with Elasticsearch instances running the same or newer minor versions.

However, for new features in newer Elasticsearch versions, the client will support them only after a new client version is released. For example, the 8.12 client does not support features in Elasticsearch 8.13. You must upgrade to the 8.13 client to use them.

Elasticsearch language clients are backward compatible only with default distributions. There are no guarantees for customized or modified versions. The table below provides compatibility information between Elasticsearch and the Elasticsearch PHP client: