Package com.flowable.indexing
Class ElasticsearchClientImpl
java.lang.Object
com.flowable.indexing.ElasticsearchClientImpl
- All Implemented Interfaces:
ElasticsearchClient
public class ElasticsearchClientImpl extends java.lang.Object implements ElasticsearchClient
-
Field Summary
Fields Modifier and Type Field Description protected static java.util.Map<java.lang.String,java.lang.String>DEFAULT_PARAMSprotected ElasticsearchCompatibilityelasticsearchCompatibilityprotected static java.lang.StringINCLUDE_TYPE_NAME_PARAMETERprotected com.fasterxml.jackson.databind.ObjectMapperobjectMapperprotected org.elasticsearch.client.RestHighLevelClientrestClient -
Constructor Summary
Constructors Constructor Description ElasticsearchClientImpl(org.elasticsearch.client.RestHighLevelClient restClient, com.fasterxml.jackson.databind.ObjectMapper objectMapper, ElasticsearchCompatibility elasticsearchCompatibility) -
Method Summary
Modifier and Type Method Description protected voidaddIncludeTypeNameParameterIfNeeded(org.elasticsearch.client.Request request)protected com.fasterxml.jackson.databind.node.ObjectNodecreateAliasActionNode(java.lang.String indexName, java.lang.String aliasName, java.lang.String action, com.fasterxml.jackson.databind.JsonNode filter)voidcreateAliasForIndex(java.lang.String alias, java.lang.String index)Creates a new alias for the given index.voidcreateCustomAlias(java.lang.String alias, java.lang.String indexMapping)com.fasterxml.jackson.databind.JsonNodecreateIndex(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.voiddeleteAliasAndRelatedIndices(java.lang.String alias)voiddeleteAliasForIndex(java.lang.String alias, java.lang.String index)voiddeleteAllIndicesWithPrefix(java.lang.String prefix)voiddeleteByQuery(java.lang.String index, com.fasterxml.jackson.databind.node.ObjectNode requestNode)voiddeleteDocument(java.lang.String alias, java.lang.String id)voiddeleteIndexIfExists(java.lang.String index)protected com.fasterxml.jackson.databind.JsonNodegetAliasesForIndex(java.lang.String index)com.fasterxml.jackson.databind.JsonNodegetById(java.lang.String index, java.lang.String id)com.fasterxml.jackson.databind.JsonNodegetIndexCurrentMapping(java.lang.String index)java.lang.StringgetIndexNameForAlias(java.lang.String alias)protected com.fasterxml.jackson.databind.JsonNodegetJsonNode(java.lang.String queryEndpoint, org.apache.http.HttpEntity entity)com.fasterxml.jackson.databind.ObjectMappergetObjectMapper()org.elasticsearch.client.RestHighLevelClientgetRestHighLevelClient()org.elasticsearch.client.RestClientgetRestLowLevelClient()com.fasterxml.jackson.databind.JsonNodegetVersionInformation()booleanindexExists(java.lang.String index)com.fasterxml.jackson.databind.JsonNodequery(java.lang.String index, com.fasterxml.jackson.databind.node.ObjectNode queryBody)com.fasterxml.jackson.databind.JsonNodequery(java.lang.String index, java.lang.String queryBody)protected voidrefreshAll()voidrefreshIndex(java.lang.String index)voidsetObjectMapper(com.fasterxml.jackson.databind.ObjectMapper objectMapper)voidswapAlias(java.lang.String alias, java.lang.String oldIndexName, java.lang.String newIndexName)Swaps the alias from one index to another index.voidsynchronousIndexDocumentRequest(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.voidsynchronousUpdateDocumentRequest(java.lang.String index, java.lang.String id, com.fasterxml.jackson.databind.node.ObjectNode objectNode, com.fasterxml.jackson.databind.node.ObjectNode scriptNode)voidsynchronousUpsertDocumentRequest(java.lang.String index, java.lang.String id, com.fasterxml.jackson.databind.node.ObjectNode objectNode)Indexes a document using an upsert queryvoidupdateAliasMapping(java.lang.String indexName, java.lang.String aliasName, com.fasterxml.jackson.databind.JsonNode indexMapping)voidupdateByQuery(java.lang.String index, com.fasterxml.jackson.databind.node.ObjectNode requestNode)voidupdateIndexMapping(java.lang.String indexName, com.fasterxml.jackson.databind.JsonNode mappingDelta)voidupdateIndexMetaData(java.lang.String index, com.fasterxml.jackson.databind.JsonNode metaData)
-
Field Details
-
DEFAULT_PARAMS
protected static java.util.Map<java.lang.String,java.lang.String> DEFAULT_PARAMS -
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 -
elasticsearchCompatibility
-
-
Constructor Details
-
ElasticsearchClientImpl
public ElasticsearchClientImpl(org.elasticsearch.client.RestHighLevelClient restClient, com.fasterxml.jackson.databind.ObjectMapper objectMapper, ElasticsearchCompatibility elasticsearchCompatibility)
-
-
Method Details
-
getIndexCurrentMapping
public com.fasterxml.jackson.databind.JsonNode getIndexCurrentMapping(java.lang.String index)- Specified by:
getIndexCurrentMappingin interfaceElasticsearchClient
-
updateIndexMetaData
public void updateIndexMetaData(java.lang.String index, com.fasterxml.jackson.databind.JsonNode metaData)- Specified by:
updateIndexMetaDatain interfaceElasticsearchClient
-
getVersionInformation
public com.fasterxml.jackson.databind.JsonNode getVersionInformation()- Specified by:
getVersionInformationin interfaceElasticsearchClient
-
createCustomAlias
public void createCustomAlias(java.lang.String alias, java.lang.String indexMapping)- Specified by:
createCustomAliasin interfaceElasticsearchClient
-
createIndex
public com.fasterxml.jackson.databind.JsonNode createIndex(java.lang.String indexName, java.lang.String alias, java.lang.String indexMapping)Description copied from interface:ElasticsearchClientCreates an index with the given name and creates an alias with the same name at the same time.- Specified by:
createIndexin interfaceElasticsearchClient- 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.
-
createAliasForIndex
public void createAliasForIndex(java.lang.String alias, java.lang.String index)Description copied from interface:ElasticsearchClientCreates a new alias for the given index.- Specified by:
createAliasForIndexin interfaceElasticsearchClient
-
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:ElasticsearchClientSwaps the alias from one index to another index.- Specified by:
swapAliasin interfaceElasticsearchClient
-
synchronousUpsertDocumentRequest
public void synchronousUpsertDocumentRequest(java.lang.String index, java.lang.String id, com.fasterxml.jackson.databind.node.ObjectNode objectNode)Description copied from interface:ElasticsearchClientIndexes a document using an upsert query- Specified by:
synchronousUpsertDocumentRequestin interfaceElasticsearchClient
-
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:ElasticsearchClientIndexes a document using external versioning through Elasticsearch Index API, overriding the whole document. Update API is not available for external versioning.- Specified by:
synchronousIndexDocumentRequestin interfaceElasticsearchClient
-
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:
synchronousUpdateDocumentRequestin interfaceElasticsearchClient
-
updateByQuery
public void updateByQuery(java.lang.String index, com.fasterxml.jackson.databind.node.ObjectNode requestNode)- Specified by:
updateByQueryin interfaceElasticsearchClient
-
deleteDocument
public void deleteDocument(java.lang.String alias, java.lang.String id)- Specified by:
deleteDocumentin interfaceElasticsearchClient
-
deleteByQuery
public void deleteByQuery(java.lang.String index, com.fasterxml.jackson.databind.node.ObjectNode requestNode)- Specified by:
deleteByQueryin interfaceElasticsearchClient
-
query
public com.fasterxml.jackson.databind.JsonNode query(java.lang.String index, com.fasterxml.jackson.databind.node.ObjectNode queryBody)- Specified by:
queryin interfaceElasticsearchClient
-
getById
public com.fasterxml.jackson.databind.JsonNode getById(java.lang.String index, java.lang.String id)- Specified by:
getByIdin interfaceElasticsearchClient
-
query
public com.fasterxml.jackson.databind.JsonNode query(java.lang.String index, java.lang.String queryBody)- Specified by:
queryin interfaceElasticsearchClient
-
getJsonNode
protected com.fasterxml.jackson.databind.JsonNode getJsonNode(java.lang.String queryEndpoint, org.apache.http.HttpEntity entity) -
deleteIndexIfExists
public void deleteIndexIfExists(java.lang.String index)- Specified by:
deleteIndexIfExistsin interfaceElasticsearchClient
-
deleteAllIndicesWithPrefix
public void deleteAllIndicesWithPrefix(java.lang.String prefix)- Specified by:
deleteAllIndicesWithPrefixin interfaceElasticsearchClient
-
indexExists
public boolean indexExists(java.lang.String index)- Specified by:
indexExistsin interfaceElasticsearchClient
-
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:
updateAliasMappingin interfaceElasticsearchClient
-
updateIndexMapping
public void updateIndexMapping(java.lang.String indexName, com.fasterxml.jackson.databind.JsonNode mappingDelta)- Specified by:
updateIndexMappingin interfaceElasticsearchClient
-
deleteAliasAndRelatedIndices
public void deleteAliasAndRelatedIndices(java.lang.String alias)- Specified by:
deleteAliasAndRelatedIndicesin interfaceElasticsearchClient
-
refreshAll
protected void refreshAll() -
deleteAliasForIndex
public void deleteAliasForIndex(java.lang.String alias, java.lang.String index)- Specified by:
deleteAliasForIndexin interfaceElasticsearchClient
-
refreshIndex
public void refreshIndex(java.lang.String index)- Specified by:
refreshIndexin interfaceElasticsearchClient
-
getIndexNameForAlias
public java.lang.String getIndexNameForAlias(java.lang.String alias)- Specified by:
getIndexNameForAliasin interfaceElasticsearchClient
-
addIncludeTypeNameParameterIfNeeded
protected void addIncludeTypeNameParameterIfNeeded(org.elasticsearch.client.Request request) -
getRestLowLevelClient
public org.elasticsearch.client.RestClient getRestLowLevelClient()- Specified by:
getRestLowLevelClientin interfaceElasticsearchClient
-
getRestHighLevelClient
public org.elasticsearch.client.RestHighLevelClient getRestHighLevelClient()- Specified by:
getRestHighLevelClientin interfaceElasticsearchClient
-
getObjectMapper
public com.fasterxml.jackson.databind.ObjectMapper getObjectMapper() -
setObjectMapper
public void setObjectMapper(com.fasterxml.jackson.databind.ObjectMapper objectMapper)
-