Class ESRestClient

    • Field Detail

      • lowLevelClient

        protected org.elasticsearch.client.RestClient lowLevelClient
      • client

        protected org.elasticsearch.client.RestHighLevelClient client
      • COMPAT_ES_OPTIONS

        protected org.elasticsearch.client.RequestOptions COMPAT_ES_OPTIONS
    • Constructor Detail

      • ESRestClient

        public ESRestClient​(org.elasticsearch.client.RestClient lowLevelRestClient,
                            org.elasticsearch.client.RestHighLevelClient client)
    • Method Detail

      • getIndexesAsString

        protected String getIndexesAsString​(String[] indexNames)
      • getHealthStatus

        public org.elasticsearch.cluster.health.ClusterHealthStatus getHealthStatus​(String[] indexNames)
        Specified by:
        getHealthStatus in interface ESClient
      • deleteIndex

        public void deleteIndex​(String indexName,
                                int timeoutSecond)
        Specified by:
        deleteIndex in interface ESClient
      • getMapping

        public String getMapping​(String indexName)
        Description copied from interface: ESClient
        Returns the mapping from elastic, exposed for testing purposes
        Specified by:
        getMapping in interface ESClient
      • performRequest

        protected org.elasticsearch.client.Response performRequest​(org.elasticsearch.client.Request request)
      • performRequestWithTracing

        public org.elasticsearch.client.Response performRequestWithTracing​(org.elasticsearch.client.Request request)
        Performs an Elastic request using the low level client, exposed since 11.5 for internal use only.
      • getFirstIndexForAlias

        public String getFirstIndexForAlias​(String aliasName)
        Description copied from interface: ESClient
        Returns the name of the index referenced by the alias. Returns null if the alias does not exists.
        Specified by:
        getFirstIndexForAlias in interface ESClient
      • deleteAlias

        protected void deleteAlias​(String aliasName)
      • createAlias

        protected void createAlias​(String aliasName,
                                   String indexName)
      • bulk

        public org.elasticsearch.action.bulk.BulkResponse bulk​(org.elasticsearch.action.bulk.BulkRequest request)
        Specified by:
        bulk in interface ESClient
      • delete

        public org.elasticsearch.action.delete.DeleteResponse delete​(org.elasticsearch.action.delete.DeleteRequest request)
        Specified by:
        delete in interface ESClient
      • search

        public org.elasticsearch.action.search.SearchResponse search​(org.elasticsearch.action.search.SearchRequest request)
        Specified by:
        search in interface ESClient
      • searchScroll

        public org.elasticsearch.action.search.SearchResponse searchScroll​(org.elasticsearch.action.search.SearchScrollRequest request)
        Specified by:
        searchScroll in interface ESClient
      • get

        public org.elasticsearch.action.get.GetResponse get​(org.elasticsearch.action.get.GetRequest request)
        Specified by:
        get in interface ESClient
      • index

        public org.elasticsearch.action.index.IndexResponse index​(org.elasticsearch.action.index.IndexRequest request)
        Description copied from interface: ESClient
        Performs the indexing request.
        Specified by:
        index in interface ESClient
      • getScopedSpan

        protected io.opencensus.common.Scope getScopedSpan​(String name,
                                                           String request)
      • clearScroll

        public org.elasticsearch.action.search.ClearScrollResponse clearScroll​(org.elasticsearch.action.search.ClearScrollRequest request)
        Specified by:
        clearScroll in interface ESClient
      • bulkProcessorBuilder

        public org.elasticsearch.action.bulk.BulkProcessor.Builder bulkProcessorBuilder​(org.elasticsearch.action.bulk.BulkProcessor.Listener bulkListener)
        Description copied from interface: ESClient
        Creates an elasticsearch BulkProcessor builder.
        Specified by:
        bulkProcessorBuilder in interface ESClient