Class ElasticsearchClientImpl

    • Constructor Summary

      Constructors 
      Constructor Description
      ElasticsearchClientImpl​(org.elasticsearch.client.RestHighLevelClient restClient, com.fasterxml.jackson.databind.ObjectMapper objectMapper, ElasticsearchCompatibility elasticsearchCompatibility)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void addIncludeTypeNameParameterIfNeeded​(org.elasticsearch.client.Request request)  
      protected org.flowable.common.engine.api.FlowableException asFlowableException​(org.elasticsearch.client.ResponseException responseException, java.lang.String fallbackMessage)  
      protected com.fasterxml.jackson.databind.node.ObjectNode createAliasActionNode​(java.lang.String indexName, java.lang.String aliasName, java.lang.String action, com.fasterxml.jackson.databind.JsonNode filter)  
      void createAliasForIndex​(java.lang.String alias, java.lang.String index)
      Creates a new alias for the given index.
      void createCustomAlias​(java.lang.String alias, java.lang.String indexMapping)  
      com.fasterxml.jackson.databind.JsonNode createIndex​(java.lang.String indexName, java.lang.String alias, java.lang.String indexMapping)
      Creates an index with the given name and creates an alias with the same name at the same time.
      void deleteAliasAndRelatedIndices​(java.lang.String alias)  
      void deleteAliasForIndex​(java.lang.String alias, java.lang.String index)  
      void deleteAllIndicesWithPrefix​(java.lang.String prefix)  
      void deleteByQuery​(java.lang.String index, com.fasterxml.jackson.databind.node.ObjectNode requestNode)  
      void deleteDocument​(java.lang.String alias, java.lang.String id)  
      void deleteIndexIfExists​(java.lang.String index)  
      protected com.fasterxml.jackson.databind.JsonNode getAliasesForIndex​(java.lang.String index)  
      com.fasterxml.jackson.databind.JsonNode getById​(java.lang.String index, java.lang.String id)  
      com.fasterxml.jackson.databind.JsonNode getIndexCurrentMapping​(java.lang.String index)  
      java.lang.String getIndexNameForAlias​(java.lang.String alias)  
      protected com.fasterxml.jackson.databind.JsonNode getJsonNode​(java.lang.String queryEndpoint, org.apache.http.HttpEntity entity)  
      com.fasterxml.jackson.databind.ObjectMapper getObjectMapper()  
      org.elasticsearch.client.RestHighLevelClient getRestHighLevelClient()  
      org.elasticsearch.client.RestClient getRestLowLevelClient()  
      com.fasterxml.jackson.databind.JsonNode getVersionInformation()  
      boolean indexExists​(java.lang.String index)  
      com.fasterxml.jackson.databind.JsonNode query​(java.lang.String index, com.fasterxml.jackson.databind.node.ObjectNode queryBody)  
      com.fasterxml.jackson.databind.JsonNode query​(java.lang.String index, java.lang.String queryBody)  
      protected void refreshAll()  
      void refreshIndex​(java.lang.String index)  
      protected java.lang.String responseMessage​(org.elasticsearch.client.Response response, java.lang.String fallbackMessage)  
      void setObjectMapper​(com.fasterxml.jackson.databind.ObjectMapper objectMapper)  
      void swapAlias​(java.lang.String alias, java.lang.String oldIndexName, java.lang.String newIndexName)
      Swaps the alias from one index to another index.
      void synchronousIndexDocumentRequest​(java.lang.String index, java.lang.String id, com.fasterxml.jackson.databind.node.ObjectNode objectNode, java.lang.Long version)
      Indexes a document using external versioning through Elasticsearch Index API, overriding the whole document.
      void synchronousUpdateDocumentRequest​(java.lang.String index, java.lang.String id, com.fasterxml.jackson.databind.node.ObjectNode objectNode, com.fasterxml.jackson.databind.node.ObjectNode scriptNode)  
      void synchronousUpsertDocumentRequest​(java.lang.String index, java.lang.String id, com.fasterxml.jackson.databind.node.ObjectNode objectNode)
      Indexes a document using an upsert query
      void updateAliasMapping​(java.lang.String indexName, java.lang.String aliasName, com.fasterxml.jackson.databind.JsonNode indexMapping)  
      void updateByQuery​(java.lang.String index, com.fasterxml.jackson.databind.node.ObjectNode requestNode)  
      void updateIndexMapping​(java.lang.String indexName, com.fasterxml.jackson.databind.JsonNode mappingDelta)  
      void updateIndexMetaData​(java.lang.String index, com.fasterxml.jackson.databind.JsonNode metaData)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • INCLUDE_TYPE_NAME_PARAMETER

        protected static final java.lang.String INCLUDE_TYPE_NAME_PARAMETER
        See Also:
        Constant Field Values
      • restClient

        protected org.elasticsearch.client.RestHighLevelClient restClient
      • objectMapper

        protected com.fasterxml.jackson.databind.ObjectMapper objectMapper
    • Constructor Detail

      • ElasticsearchClientImpl

        public ElasticsearchClientImpl​(org.elasticsearch.client.RestHighLevelClient restClient,
                                       com.fasterxml.jackson.databind.ObjectMapper objectMapper,
                                       ElasticsearchCompatibility elasticsearchCompatibility)
    • Method Detail

      • updateIndexMetaData

        public void updateIndexMetaData​(java.lang.String index,
                                        com.fasterxml.jackson.databind.JsonNode metaData)
        Specified by:
        updateIndexMetaData in interface ElasticsearchClient
      • createIndex

        public com.fasterxml.jackson.databind.JsonNode createIndex​(java.lang.String indexName,
                                                                   java.lang.String alias,
                                                                   java.lang.String indexMapping)
        Description copied from interface: ElasticsearchClient
        Creates an index with the given name and creates an alias with the same name at the same time.
        Specified by:
        createIndex in interface ElasticsearchClient
        Parameters:
        indexName - The name of the index.
        alias - The alias name for the index. If alias is null, NO alias will be created, but the index still will be created.
        indexMapping - The full ES mapping json that will be created.
      • getAliasesForIndex

        protected com.fasterxml.jackson.databind.JsonNode getAliasesForIndex​(java.lang.String index)
      • swapAlias

        public void swapAlias​(java.lang.String alias,
                              java.lang.String oldIndexName,
                              java.lang.String newIndexName)
        Description copied from interface: ElasticsearchClient
        Swaps the alias from one index to another index.
        Specified by:
        swapAlias in interface ElasticsearchClient
      • synchronousUpsertDocumentRequest

        public void synchronousUpsertDocumentRequest​(java.lang.String index,
                                                     java.lang.String id,
                                                     com.fasterxml.jackson.databind.node.ObjectNode objectNode)
        Description copied from interface: ElasticsearchClient
        Indexes a document using an upsert query
        Specified by:
        synchronousUpsertDocumentRequest in interface ElasticsearchClient
      • synchronousIndexDocumentRequest

        public void synchronousIndexDocumentRequest​(java.lang.String index,
                                                    java.lang.String id,
                                                    com.fasterxml.jackson.databind.node.ObjectNode objectNode,
                                                    java.lang.Long version)
        Description copied from interface: ElasticsearchClient
        Indexes a document using external versioning through Elasticsearch Index API, overriding the whole document. Update API is not available for external versioning.
        Specified by:
        synchronousIndexDocumentRequest in interface ElasticsearchClient
      • synchronousUpdateDocumentRequest

        public void synchronousUpdateDocumentRequest​(java.lang.String index,
                                                     java.lang.String id,
                                                     com.fasterxml.jackson.databind.node.ObjectNode objectNode,
                                                     com.fasterxml.jackson.databind.node.ObjectNode scriptNode)
        Specified by:
        synchronousUpdateDocumentRequest in interface ElasticsearchClient
      • updateByQuery

        public void updateByQuery​(java.lang.String index,
                                  com.fasterxml.jackson.databind.node.ObjectNode requestNode)
        Specified by:
        updateByQuery in interface ElasticsearchClient
      • deleteByQuery

        public void deleteByQuery​(java.lang.String index,
                                  com.fasterxml.jackson.databind.node.ObjectNode requestNode)
        Specified by:
        deleteByQuery in interface ElasticsearchClient
      • query

        public com.fasterxml.jackson.databind.JsonNode query​(java.lang.String index,
                                                             com.fasterxml.jackson.databind.node.ObjectNode queryBody)
        Specified by:
        query in interface ElasticsearchClient
      • getById

        public com.fasterxml.jackson.databind.JsonNode getById​(java.lang.String index,
                                                               java.lang.String id)
        Specified by:
        getById in interface ElasticsearchClient
      • query

        public com.fasterxml.jackson.databind.JsonNode query​(java.lang.String index,
                                                             java.lang.String queryBody)
        Specified by:
        query in interface ElasticsearchClient
      • getJsonNode

        protected com.fasterxml.jackson.databind.JsonNode getJsonNode​(java.lang.String queryEndpoint,
                                                                      org.apache.http.HttpEntity entity)
      • createAliasActionNode

        protected com.fasterxml.jackson.databind.node.ObjectNode createAliasActionNode​(java.lang.String indexName,
                                                                                       java.lang.String aliasName,
                                                                                       java.lang.String action,
                                                                                       com.fasterxml.jackson.databind.JsonNode filter)
      • updateAliasMapping

        public void updateAliasMapping​(java.lang.String indexName,
                                       java.lang.String aliasName,
                                       com.fasterxml.jackson.databind.JsonNode indexMapping)
        Specified by:
        updateAliasMapping in interface ElasticsearchClient
      • updateIndexMapping

        public void updateIndexMapping​(java.lang.String indexName,
                                       com.fasterxml.jackson.databind.JsonNode mappingDelta)
        Specified by:
        updateIndexMapping in interface ElasticsearchClient
      • refreshAll

        protected void refreshAll()
      • addIncludeTypeNameParameterIfNeeded

        protected void addIncludeTypeNameParameterIfNeeded​(org.elasticsearch.client.Request request)
      • getObjectMapper

        public com.fasterxml.jackson.databind.ObjectMapper getObjectMapper()
      • setObjectMapper

        public void setObjectMapper​(com.fasterxml.jackson.databind.ObjectMapper objectMapper)
      • asFlowableException

        protected org.flowable.common.engine.api.FlowableException asFlowableException​(org.elasticsearch.client.ResponseException responseException,
                                                                                       java.lang.String fallbackMessage)
      • responseMessage

        protected java.lang.String responseMessage​(org.elasticsearch.client.Response response,
                                                   java.lang.String fallbackMessage)