Releases: elastic/elasticsearch-java
v9.0.0
What's Changed
Check the official release notes - in particular the breaking changes! Also we have a new Reference page.
A migration guide from version 8.x to 9.x of the client will be published soon to make the upgrade process easier.
The easiest way to setup the new 9.0.0 client is to use the new builder, as explained in the new docs:
ElasticsearchClient esClient = ElasticsearchClient.of(b -> b
.host(serverUrl)
.apiKey(apiKey)
);
Otherwise to keep using the old builder and the legacy RestClient, the elasticsearch-rest-client dependency has to be added to the project:
// gradle
implementation("org.elasticsearch.client:elasticsearch-rest-client:9.0.0")
Full Changelog: v8.18.0...v9.0.0
v8.18.0
What's Changed
Check the official release notes.
Full Changelog: v8.17.5...v8.18.0
v8.17.5
What's Changed
Check v8.16.7 release notes for the most prominent changes.
Full Changelog: v8.17.4...v8.17.5
v8.16.7
What's Changed
Bugfixes
-
Inference API: fixed
getTrainedModels
, which was broken as reported in #964 and #967, because of missing fields. -
FunctionScoreQuery: our effort to support more shortcut properties (see #858) inadvertently broken deserialization for the standard syntax of
FuncitonScoreQuery
(as reported in #917 ), so we reverted those changes for this particular class.
Feature Preview
Since this is the last patch release for 8.16, we decided to preview some of the features that will be available in future versions of the client. None of these are breaking changes, they are all overloads of existing methods.
Default class for methods requiring TDocument
Some requests in the client require a second parameter to define the result class, for example search
, meaning the compiler will complain while the query is being written, which can be annoying. We added overload methods that use Void.class as default type, so that the correct type can be eventually added later into writing the query.
Example with search
:
-
Old:
esClient.search(s -> s .index("my-index") .query(q -> q .matchAll(m -> m) ) ,Object.class);
-
New:
esClient.search(s -> s .index("my-index") .query(q -> q .matchAll(m -> m) ) );
Builder setters overloads with variant type
Added more setters allowing to build requests with a specific type variant instead of having to use the parent class and then select the desired variant later.
Example with query
, where the query
field can now accept a MatchAllQuery
(or any other variant) directly:
- Old:
esClient.search(s -> s .index("my-index") .query(q -> q .matchAll(m -> m) ) );
- New:
esClient.search(s -> s .index("my-index") .query(MatchAllQuery.of(m -> m)) );
Example with aggregations
, where the aggregations
field can now accept AverageAggregation
(or any other variant) drectly:
- Old:
// using functional builder shortcut esClient.search(s -> s .aggregations("agg", a -> a .avg(av -> av .field("price")) ) ); // using Aggregation class builder esClient.search(s -> s .aggregations("agg", Aggregation.of(ag -> ag .avg(av -> av .field("price")) ) ) );
- New:
esClient.search(s -> s .aggregations("agg", AverageAggregation.of(av -> av .field("price")) ) );
Full Changelog: v8.16.6...v8.16.7
v8.17.4
What's Changed
Full Changelog: v8.17.3...v8.17.4
v8.16.6
What's Changed
Full Changelog: v8.16.5...v8.16.6
v8.17.3
What's Changed
Full Changelog: v8.17.2...v8.17.3
v8.16.5
What's Changed
Full Changelog: v8.16.4...v8.16.5
v8.17.2
What's Changed
Full Changelog: v8.17.1...v8.17.2
v8.16.4
What's Changed
Full Changelog: v8.16.3...v8.16.4