Class RestHighLevelClient

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable

    public class RestHighLevelClient
    extends java.lang.Object
    implements java.io.Closeable
    High level REST client that wraps an instance of the low level RestClient and allows to build requests and read responses. The RestClient instance is internally built based on the provided RestClientBuilder and it gets closed automatically when closing the RestHighLevelClient instance that wraps it. In case an already existing instance of a low-level REST client needs to be provided, this class can be subclassed and the RestHighLevelClient(RestClient, CheckedConsumer, List) constructor can be used. This class can also be sub-classed to expose additional client methods that make use of endpoints added to Elasticsearch through plugins, or to add support for custom response sections, again added to Elasticsearch through plugins.