Add api compatibility header support (#1478) (#1491)

Co-authored-by: Tomas Della Vedova <delvedor@users.noreply.github.com>
This commit is contained in:
github-actions[bot]
2021-07-13 09:48:30 +02:00
committed by GitHub
parent ea2c8d2d4d
commit 28d8ff799e
4 changed files with 75 additions and 4 deletions

View File

@ -83,4 +83,18 @@ class MySerializer extends Serializer {
const client = new Client({
Serializer: MySerializer
})
----
----
[discrete]
==== Migrate to v8
The Node.js client can be configured to emit an HTTP header
``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 for
upgrading 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 to setting, configure the environment variable
``ELASTIC_CLIENT_APIVERSIONING`` to ``true``.