Using the Java programming language the following are the ways by which Elasticsearch can be communicated.
- Transport Client: Used by REST clients internally. Full support from Elasticsearch as these are used by Elasticsearch internally to achieve various tasks. The most efficient methodology for communication and is quite fast. It uses a binary protocol for communication, the same protocol Elasticsearch uses internally. The following code shows how can you acquire the transport client to communicate with the Elasticsearch. More details on this can be found in elastic's official blog here https://goo.gl/0ZKZIk:
TransportAddress address = new InetSocketTransportAddress(InetAddress.getByName("localhost"), 9200);
Settings settings = Settings.builder().put("cluster.name", "dataLakeCluster").build();
Client client = new PreBuiltTransportClient(settings).addTransportAddress...