Using the Elasticsearch official Java client
The official Java client is built on top of a low-level one and provides strong typed communication with Elasticsearch.
Initially released with Elasticsearch in the latest versions of 7.15 or above, this client is the official Java client for Elasticsearch 8.x. It provides many extra functionalities, such as the following:
- Integration from application classes to JSON instances via an object mapper such as Jackson
- Request/response marshaling/unmarshaling that provides stronger typed programming
- Support for both synchronous and asynchronous calls
- Use of fluent builders and functional patterns to allow writing concise yet readable code when creating complex nested structures
- Built on top of previous low-level client
Getting ready
You need an up-and-running Elasticsearch installation, as we described in the Downloading and installing Elasticsearch recipe in Chapter 1, Getting Started.
To correctly execute...