This PR adds the support for API compatibility header. Starting from version 7.13, Elasticsearch supports a compatibility header in Content-Type and Accept. The elasticsearch-php client can be configured to emit the following HTTP headers:
which signals to Elasticsearch that the client is requesting 7.x version of request and response bodies. This allows forupgrading from 7.x to 8.x version of Elasticsearch without upgrading everything at once. Elasticsearch should be upgraded first after the compatibility header is configured and clients should be upgraded second.
To enable this compatibility header you need to create a ELASTIC_CLIENT_APIVERSIONING environment variable and set it to true or 1.
This PR adds the support for API compatibility header. Starting from version 7.13, Elasticsearch supports a compatibility header in
Content-Type
andAccept
. Theelasticsearch-php
client can be configured to emit the following HTTP headers:which signals to Elasticsearch that the client is requesting
7.x
version of request and response bodies. This allows forupgrading from 7.x to 8.x version of Elasticsearch without upgrading everything at once. Elasticsearch should be upgraded first after the compatibility header is configured and clients should be upgraded second.To enable this compatibility header you need to create a
ELASTIC_CLIENT_APIVERSIONING
environment variable and set it totrue
or1
.