From c6e0a8fabf84e9ba9f924fd4737d6836796e7bc0 Mon Sep 17 00:00:00 2001 From: Laura Trotta Date: Tue, 8 Apr 2025 15:34:55 +0200 Subject: [PATCH 1/3] docs --- .../release-notes/release-highlights.asciidoc | 173 ++++++++++++++++++ 1 file changed, 173 insertions(+) diff --git a/docs/release-notes/release-highlights.asciidoc b/docs/release-notes/release-highlights.asciidoc index 49ee99ed8..b71d0c092 100644 --- a/docs/release-notes/release-highlights.asciidoc +++ b/docs/release-notes/release-highlights.asciidoc @@ -5,6 +5,179 @@ These are the important new features and changes in minor releases. Every releas For a list of detailed changes, including bug fixes, please see the https://github.com/elastic/elasticsearch-java/releases[GitHub project realease notes]. +[discrete] +==== Version 8.18 + +===== Breaking changes + +While we try to limit breaking changes to the minimum between minor versions of the client, all the following changes were necessary to keep the client code in sync with the server code and to fix client side bugs. + +* Removed deprecated `LanguageAnalyzer` +* Removed unused `NodeReloadError` +* Removed unused `SearchApplicationListItem` +* Removed `InferenceRequest`, `InferenceResponse`, `InferenceResult`, `InferenceResultVariant` as part of a complete refactor of the Inference API + +* `SearchRequest`,`SubmitRequest`: `indicesBoost` field modified from `List>` to `List>`, because the server does not accept more than one value in the map. +** Old: ++ +[source,java] +---- +esClient.search(s -> s + .index("*") + .indicesBoost(Map.of("index", 1.0)) +,Void.class); +---- ++ +** New: ++ +[source,java] +---- +esClient.search(s -> s + .index("*") + .indicesBoost(NamedValue.of("index", 1.0)) +,Void.class); +---- ++ + +* `PutMappingRequest`: `dynamicTemplates` field modified from `List>` to `List>`, same reason as above. +* `DenseVectorIndexOptions`: `type` field modified from `String` to enum `DenseVectorIndexOptionsType` +* `DenseVectorProperty`: + ** `elementType` field modified from `String` to enum `DenseVectorElementType` + ** `similarity` field modified from `String` to enum `DenseVectorSimilarity` +* `DynamicTemplate`: `runtime` field modified from `Property` to `RuntimeField`, fixing a previous wrong mapping of the property. +* `ObjectProperty`: `subobjects` field modified from `Boolean` to `Subobjects` +* `TypeMapping`: `subobjects` field modified from `Boolean` to `Subobjects` +* `FollowerIndexParameters`: + ** `maxOutstandingReadRequests` field modified from `int` to `Long`, now optional + ** `maxOutstandingWriteRequests` field modified from `int` to `Integer`, now optional + ** `maxReadRequestOperationCount` field modified from `int` to `Integer`, now optional + ** `maxWriteBufferCount` field modified from `int` to `Integer`, now optional + ** `maxWriteRequestOperationCount` field modified from `int` to `Integer`, now optional +* `FollowRequest` + ** `maxOutstandingWriteRequests` field modified from `Long` to `Integer` + ** `maxReadRequestOperationCount` field modified from `Long` to `Integer` + ** `maxWriteBufferCount` field modified from `Long` to `Integer` + ** `maxWriteRequestOperationCount` field modified from `Long` to `Integer` +* `ScriptsPainlessExecuteRequest`: `context` field modified from `String` to `PainlessContext` +* `DataStreamWithLifecycle`: `lifecycle` field modified from `DataStreamLifecycle` to `DataStreamLifecycleWithRollover` +* `elasticsearch.search_application.PutRequest`: `searchApplication` field modified from `SearchApplication` to `SearchApplicationParameters` +* `TrainedModelDeploymentNodesStats`: `routingState` field modified from `TrainedModelAssignmentRoutingTable` to `TrainedModelAssignmentRoutingStateAndReason` + + +===== New Features + +====== BulkIngester retry policy + +Retry logic can now be enabled allowing the BulkIngester to retry operations that failed with error 429 (too many requests), hoping that the error will recover and the request will go through. Users can configure the desired backoff policy using the backoffPolicy() method in the BulkIngester builder: +[source,java] +---- +BulkIngester ingester = BulkIngester.of(b -> b + .client(client) + ... + .listener(listener) + .flushInterval(1000, TimeUnit.MILLISECONDS) + .backoffPolicy(BackoffPolicy.constantBackoff(50L, 8)) +---- +This is an example of constant backoff, meaning the single failed operation will be retried 8 times every 50 milliseconds. + +====== 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: + +[source,java] +---- +esClient.search(s -> s + .index("my-index") + .query(q -> q + .matchAll(m -> m) + ) +,Object.class); +---- + + +- New: + +[source,java] +---- +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: + +[source,java] +---- +esClient.search(s -> s + .index("my-index") + .query(q -> q + .matchAll(m -> m) + ) +); +---- +- New: + +[source,java] +---- +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: + +[source,java] +---- +// 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: + +[source,java] +---- +esClient.search(s -> s + .aggregations("agg", AverageAggregation.of(av -> av + .field("price")) + ) +); +---- + +[discrete] +==== Version 8.17 +* No new feature. + [discrete] ==== Version 8.16 * `ElasticsearchClient` is now `Closeable`. Closing a client object also closes the underlying transport - https://github.com/elastic/elasticsearch-java/pull/851[#851] From c6545106a3ec414586068c16ac02f05139bba90c Mon Sep 17 00:00:00 2001 From: Laura Trotta Date: Fri, 11 Apr 2025 12:09:56 +0200 Subject: [PATCH 2/3] typo --- docs/release-notes/release-highlights.asciidoc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/release-notes/release-highlights.asciidoc b/docs/release-notes/release-highlights.asciidoc index b71d0c092..18282f695 100644 --- a/docs/release-notes/release-highlights.asciidoc +++ b/docs/release-notes/release-highlights.asciidoc @@ -82,7 +82,7 @@ This is an example of constant backoff, meaning the single failed operation will ====== 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. +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`: @@ -138,7 +138,7 @@ esClient.search(s -> s ); ---- -Example with `aggregations`, where the `aggregations` field can now accept `AverageAggregation` (or any other variant) drectly: +Example with `aggregations`, where the `aggregations` field can now accept `AverageAggregation` (or any other variant) directly: - Old: From bf5cf3e31d35bf22da9341acfe8a6c3184d4a0d6 Mon Sep 17 00:00:00 2001 From: Laura Trotta Date: Fri, 11 Apr 2025 14:53:41 +0200 Subject: [PATCH 3/3] md syntax fix --- .../release-notes/release-highlights.asciidoc | 37 ++++++++++--------- 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/docs/release-notes/release-highlights.asciidoc b/docs/release-notes/release-highlights.asciidoc index 18282f695..9be08f8eb 100644 --- a/docs/release-notes/release-highlights.asciidoc +++ b/docs/release-notes/release-highlights.asciidoc @@ -8,7 +8,7 @@ For a list of detailed changes, including bug fixes, please see the https://gith [discrete] ==== Version 8.18 -===== Breaking changes +**Breaking changes** While we try to limit breaking changes to the minimum between minor versions of the client, all the following changes were necessary to keep the client code in sync with the server code and to fix client side bugs. @@ -64,11 +64,12 @@ esClient.search(s -> s * `TrainedModelDeploymentNodesStats`: `routingState` field modified from `TrainedModelAssignmentRoutingTable` to `TrainedModelAssignmentRoutingStateAndReason` -===== New Features - -====== BulkIngester retry policy +**New Features** +* BulkIngester retry policy ++ Retry logic can now be enabled allowing the BulkIngester to retry operations that failed with error 429 (too many requests), hoping that the error will recover and the request will go through. Users can configure the desired backoff policy using the backoffPolicy() method in the BulkIngester builder: ++ [source,java] ---- BulkIngester ingester = BulkIngester.of(b -> b @@ -78,16 +79,17 @@ BulkIngester ingester = BulkIngester.of(b -> b .flushInterval(1000, TimeUnit.MILLISECONDS) .backoffPolicy(BackoffPolicy.constantBackoff(50L, 8)) ---- ++ This is an example of constant backoff, meaning the single failed operation will be retried 8 times every 50 milliseconds. -====== Default class for methods requiring TDocument - +* 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: - ++ [source,java] ---- esClient.search(s -> s @@ -98,9 +100,8 @@ esClient.search(s -> s ,Object.class); ---- - - New: - ++ [source,java] ---- esClient.search(s -> s @@ -111,14 +112,14 @@ esClient.search(s -> s ); ---- -====== Builder setters overloads with variant type - +* 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: - ++ [source,java] ---- esClient.search(s -> s @@ -129,7 +130,7 @@ esClient.search(s -> s ); ---- - New: - ++ [source,java] ---- esClient.search(s -> s @@ -137,11 +138,11 @@ esClient.search(s -> s .query(MatchAllQuery.of(m -> m)) ); ---- - ++ Example with `aggregations`, where the `aggregations` field can now accept `AverageAggregation` (or any other variant) directly: - Old: - ++ [source,java] ---- // using functional builder shortcut @@ -164,7 +165,7 @@ esClient.search(s -> s ---- - New: - ++ [source,java] ---- esClient.search(s -> s