Trying out ES 9 — any Java API changes?

When upgrading from Elasticsearch 8 to 9, do I need to update my application server Java code? I use the ES 8 Java API to talk to an ES 8 (and 9?) server.

Is there any ES Java client version 9, for talking with ES server version 9? With some (breaking?) API changes? Or can I just continue using the ES 8 client, no changes required, except for upgrading to an ES 9 server? (With "client" here being my application server.)

In the ES 9.0.0-RC announcement: [ANNOUNCEMENT] - Elastic 9.0.0-RC1 is available, a Docker image is mentioned — that means I'd start using an ES 9 server. But there's nothing about any ES 9 client, or 8 —> 9 API changes. No version 9 over at the ES docs website: Elasticsearch Guide [8.17] | Elastic (as of April 5 2025).

Nice with a new version of ES anyway :- ) Looking forward to upgrading

There will be, but it might follow some time after the server release. However ...

... certainly as an interim measure this is what we expect folks to do. Elasticsearch has a REST compatibility mode which keeps the 8.x response format even in 9.x clusters to keep clients working across the upgrade.

1 Like

Ok that sounds great :- ) Then I'll experiment with upgrading only the server, and see what'll happen.

(To use the REST compatibility mode, apparently I need to add:

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

(from the docs you linked, and 8 instead of 7))

AIUI the Java client adds these headers automatically, you don't need to take any action to enable this compatibility mode when working with a v9 cluster.