Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for API Compatibility Header #1142

Merged
merged 1 commit into from
May 18, 2021
Merged

Add support for API Compatibility Header #1142

merged 1 commit into from
May 18, 2021

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