Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/reference/setup/connecting.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ mapped_pages:
The Java API Client is structured around three main components:

* **API client classes**. These provide strongly typed data structures and methods for {{es}} APIs. Since the {{es}} API is large, it is structured in feature groups (also called “namespaces”), each having its own client class. {{es}} core features are implemented in the `ElasticsearchClient` class.
* **A JSON object mapper**. This maps your application classes to JSON and seamlessly integrates them with the API client. The default implementation uses Jackson.
* **A JSON object mapper**. This maps your application classes to JSON and seamlessly integrates them with the API client. The default implementation uses Jackson version 2.
* **A transport layer implementation**. This is where all HTTP request handling takes place. The [default implementation](/reference/transport/rest5-client/index.md) is based on the [Apache http client library](https://hc.apache.org/).

This code snippet uses the default configurations and only needs the location and credentials to connect to Elasticsearch:
Expand Down
1 change: 1 addition & 0 deletions docs/reference/transport/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ navigation_title: Transport layer
The Java API client comes with two JSON mapping implementations:

* `JacksonJsonpMapper`, the default implementation based on the popular [Jackson](https://github.com/FasterXML/jackson) library.
* `Jackson3JsonpMapper`, based on the new [Jackson](https://github.com/FasterXML/jackson) library version 3.
* `JsonbJsonpMapper`, based on the JakartaEE JSONP specification, which allows using any implementation of this specification such as [Eclipse Parsson](https://github.com/eclipse-ee4j/parsson)

Which implementation should you use?
Expand Down
112 changes: 112 additions & 0 deletions docs/release-notes/9-2-0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
---
navigation_title: "9.2.0"
---
# Elasticsearch Java Client 9.2.0 [elasticsearch-java-client-920]

Discover what changed in the 9.2.0 version of the Java client.

## Breaking changes [elasticsearch-java-client-920-breaking-changes]

::::{dropdown} Map to NamedValue CompositeAggregation.sources
`sources` in `CompositeAggregation` was wrongly mapped as `List<Map>`, but the server doesn't actually accept more than one value, so the type has been changed to `List<NamedValue>`.

**Action**<br> Change the builder to use the correct type.
Example:
- Old
```java
esClient.search(s -> s
.aggregations("agg", a -> a
.composite(c -> c
.sources(Map.of("source", CompositeAggregationSource.of(cas -> cas...))))
)
);
```
- New
```java
esClient.search(s -> s
.aggregations("agg", a -> a
.composite(c -> c
.sources(NamedValue.of("source", CompositeAggregationSource.of(cas -> cas...))))
)
);
```

::::

::::{dropdown} String to Double GetOverallBucketsRequest.overallScore
`overallScore` in `GetOverallBucketsRequest` was wrongly mapped as `String`, but the correct value to be sent to the server is `Double`, so the type has been changed to `Double`.

**Action**<br> Change the builder to use the correct type.
Example:
- Old
```java
esClient.ml()
.getOverallBuckets(b -> b
.overallScore("2")
...
);
```
- New
```java
esClient.ml()
.getOverallBuckets(b -> b
.overallScore(2D)
...
);
```
::::

::::{dropdown} Level to NodeStatsLevel NodesStatsRequest.level
`level` in `NodesStatsRequest` was wrongly mapped as the `Level` enum, which did not match the values accepted by the server, so it has been replaced with `NodeStatsLevel`.

**Action**<br> Change the builder to use the correct enum.
Example:
- Old
```java
esClient.nodes()
.stats(s -> s
.level(Level.Indices)
);
```
- New
```java
esClient.nodes()
.stats(s -> s
.level(NodeStatsLevel.Indices)
);
```
::::

::::{dropdown} TimeUnit to Time StreamsStatusRequest.masterTimeout
`masterTimeout` in `StreamsStatusRequest` was wrongly mapped as `TimeUnit`, but the correct value to be sent to the server is `Time`, so the type has been changed to `Time`.

**Action**<br> Change the builder to use the correct type.
Example:
```java
esClient.streams()
.status(s -> s
.masterTimeout(Time.of(t -> t.time("10s")))
);
```
::::


## Features and enhancements [elasticsearch-java-client-920-features-enhancements]

::::{dropdown} Jackson 3 implementation of the JSON object mapper
Following the stable release of the [Jackson library version 3](https://github.com/FasterXML/jackson/wiki/Jackson-Release-3.0), the Jackson 3 implementation of object mapper is now available!
The default implementation will stay version 2 for now, so to try the new implementation replace `JacksonJsonpMapper` with `Jackson3JsonpMapper`.
Example with shortcut builder:
```java
try (ElasticsearchClient client = ElasticsearchClient.of(e -> e
.jsonMapper(new Jackson3JsonpMapper())
.host("your-host")
.apiKey("your-api-keys"))) {
...
}
```
::::

## Deprecations [elasticsearch-java-client-920-deprecations]

Nothing was deprecated in this version of the client.
3 changes: 3 additions & 0 deletions docs/release-notes/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ To check for security updates, refer to [Security announcements for the Elastic

To check for issues, refer to [Known issues](../release-notes/known-issues.md).

## 9.2.0
[Release notes](../release-notes/9-2-0.md)

## 9.1.0
[Release notes](../release-notes/9-1-0.md)

Expand Down
1 change: 1 addition & 0 deletions docs/release-notes/toc.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
toc:
- file: index.md
- file: known-issues.md
- file: 9-2-0.md
- file: 9-1-0.md
- file: 9-0-4.md
- file: 9-0-0.md
Original file line number Diff line number Diff line change
Expand Up @@ -276,12 +276,16 @@ public boolean isRunning() {
* exception this isn't always possible and likely haven't covered all of
* the cases. You can get the original exception from
* {@link Exception#getCause()}.
* <p>
* Differently from the legacy RestClient, this method does not throw exception
* in case of 4xx errors from the server, since often the server returns 4xx exceptions with
* bodies as part of the standard workflow.
*
* @param request the request to perform
* @return the response returned by Elasticsearch
* @throws IOException in case of a problem or the connection was aborted
* @throws ClientProtocolException in case of an http protocol error
* @throws ResponseException in case Elasticsearch responded with a status code that indicated an
* @throws ResponseException in case Elasticsearch responded with a 5xx status code that indicated an
* error
*/
public Response performRequest(Request request) throws IOException {
Expand Down
Loading