Chapter 13: Java Integration
Elasticsearch functionalities can be easily integrated into any Java application in a couple of ways, via a REST API or via native APIs. In Java, it's easy to call a REST HTTP interface with one of the many libraries available, such as the Apache HttpComponents client (see http://hc.apache.org/ for more information). In this field, there's no such thing as the most used library; typically, developers choose the library that best suits their preferences or one that they know very well. From Elasticsearch 6.x onward, Elastic has provided a battle low-/high-level HTTP for clients to use. In version 8.x, Elastic released a modern/functional/strongly typed client and in this chapter, we will mainly use this version for all the examples that are provided.
Each Java Virtual Machine (JVM) language can also use the native protocol to integrate Elasticsearch with their applications; however, we will not cover this because it has fallen out of use from...