Skip to content

Conversation

ezimuel
Copy link
Contributor

@ezimuel ezimuel commented May 17, 2021

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:

Content-Type: application/vnd.elasticsearch+json; compatible-with=7
Accept: application/vnd.elasticsearch+json; compatible-with=7

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.

Copy link
Contributor

@philkra philkra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants