Elasticsearch functionalities can be easily integrated in any Java application in a couple of ways: via a REST API and via native ones. In Java, it's easy to call a REST HTTP interface with one of the many of 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 this chapter, we will mainly use these ones for all the examples that are provided.
Each JVM language can also use the native protocol to integrate Elasticsearch with their applications; however, we will not cover this because it has fallen...