August 2019
Intermediate to advanced
560 pages
13h 41m
English
As we've said, the high-level REST client is built on the top of the low-level REST client, so the constructor takes the RestClientBuilder object as an argument to build the high-level REST client object. Our example is shown in the following code block and is similar to the low-level REST client:
public RestHighLevelClient HighLevelRestClient() { return new RestHighLevelClient( RestClient.builder(new HttpHost("localhost", 9200, "http")) .setDefaultHeaders(new Header[] { new BasicHeader("accept","application/json"), new BasicHeader("content-type","application/json")}) .setFailureListener(new RestClient.FailureListener() { public void onFailure(Node node) { logger.error("High level Rest Client Failure on node " ...Read now
Unlock full access