Package com.flowable.indexing
Class ElasticsearchClientImpl
java.lang.Object
com.flowable.indexing.ElasticsearchClientImpl
- All Implemented Interfaces:
ElasticsearchClient
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.flowable.indexing.ElasticsearchClient
ElasticsearchClient.BulkRequestClient
-
Field Summary
Modifier and TypeFieldDescriptionprotected org.elasticsearch.client.RequestOptions
protected ElasticsearchCompatibility
protected static final String
protected com.fasterxml.jackson.databind.ObjectMapper
protected org.elasticsearch.client.RestClient
-
Constructor Summary
ConstructorDescriptionElasticsearchClientImpl
(org.elasticsearch.client.RestClient restClient, com.fasterxml.jackson.databind.ObjectMapper objectMapper, ElasticsearchCompatibility elasticsearchCompatibility, org.elasticsearch.client.RequestOptions defaultRequestOptions) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
addIncludeTypeNameParameterIfNeeded
(org.elasticsearch.client.Request request) protected FlowableException
asFlowableException
(org.elasticsearch.client.ResponseException responseException, String fallbackMessage) protected com.fasterxml.jackson.databind.node.ObjectNode
createAliasActionNode
(String indexName, String aliasName, String action, com.fasterxml.jackson.databind.JsonNode filter) void
createAliasForIndex
(String alias, String index) Creates a new alias for the given index.void
createCustomAlias
(String alias, String indexMapping) com.fasterxml.jackson.databind.JsonNode
createIndex
(String indexName, String alias, String indexMapping) Creates an index with the given name and creates an alias with the same name at the same time.void
void
deleteAliasForIndex
(String alias, String index) void
deleteByQuery
(String index, com.fasterxml.jackson.databind.node.ObjectNode requestNode) void
deleteDocument
(String alias, String id) void
deleteIndexIfExists
(String index) protected com.fasterxml.jackson.databind.JsonNode
getAliasesForIndex
(String index) com.fasterxml.jackson.databind.JsonNode
com.fasterxml.jackson.databind.JsonNode
getIndexCurrentMapping
(String index) com.fasterxml.jackson.databind.JsonNode
getIndexCurrentSettings
(String index) getIndexNameForAlias
(String alias) protected com.fasterxml.jackson.databind.JsonNode
getJsonNode
(String queryEndpoint, org.apache.http.HttpEntity entity) com.fasterxml.jackson.databind.ObjectMapper
com.fasterxml.jackson.databind.JsonNode
boolean
indexExists
(String index) protected org.elasticsearch.client.Response
performRequest
(org.elasticsearch.client.Request request) com.fasterxml.jackson.databind.JsonNode
com.fasterxml.jackson.databind.JsonNode
query
(String index, com.fasterxml.jackson.databind.node.ObjectNode queryBody, boolean returnVersion) com.fasterxml.jackson.databind.JsonNode
com.fasterxml.jackson.databind.JsonNode
protected void
void
refreshIndex
(String index) protected String
responseMessage
(org.elasticsearch.client.Response response, String fallbackMessage) com.fasterxml.jackson.databind.JsonNode
setIndexSettings
(String index, com.fasterxml.jackson.databind.node.ObjectNode settings) void
setObjectMapper
(com.fasterxml.jackson.databind.ObjectMapper objectMapper) void
Swaps the alias from one index to another index.void
synchronousIndexDocumentRequest
(String index, String id, com.fasterxml.jackson.databind.node.ObjectNode objectNode, Long version) Indexes a document using external versioning through Elasticsearch Index API, overriding the whole document.void
synchronousUpdateDocumentRequest
(String index, String id, com.fasterxml.jackson.databind.node.ObjectNode objectNode, com.fasterxml.jackson.databind.node.ObjectNode scriptNode) void
synchronousUpsertDocumentRequest
(String index, String id, com.fasterxml.jackson.databind.node.ObjectNode objectNode) Indexes a document using an upsert queryvoid
updateAliasMapping
(String indexName, String aliasName, com.fasterxml.jackson.databind.JsonNode indexMapping) void
updateByQuery
(String index, com.fasterxml.jackson.databind.node.ObjectNode requestNode) void
updateIndexMapping
(String indexName, com.fasterxml.jackson.databind.JsonNode mappingDelta) void
updateIndexMetaData
(String index, com.fasterxml.jackson.databind.JsonNode metaData)
-
Field Details
-
INCLUDE_TYPE_NAME_PARAMETER
- See Also:
-
restClient
protected org.elasticsearch.client.RestClient restClient -
objectMapper
protected com.fasterxml.jackson.databind.ObjectMapper objectMapper -
elasticsearchCompatibility
-
defaultRequestOptions
protected org.elasticsearch.client.RequestOptions defaultRequestOptions
-
-
Constructor Details
-
ElasticsearchClientImpl
public ElasticsearchClientImpl(org.elasticsearch.client.RestClient restClient, com.fasterxml.jackson.databind.ObjectMapper objectMapper, ElasticsearchCompatibility elasticsearchCompatibility, org.elasticsearch.client.RequestOptions defaultRequestOptions)
-
-
Method Details
-
getIndexCurrentMapping
- Specified by:
getIndexCurrentMapping
in interfaceElasticsearchClient
-
getIndexCurrentSettings
- Specified by:
getIndexCurrentSettings
in interfaceElasticsearchClient
-
setIndexSettings
public com.fasterxml.jackson.databind.JsonNode setIndexSettings(String index, com.fasterxml.jackson.databind.node.ObjectNode settings) - Specified by:
setIndexSettings
in interfaceElasticsearchClient
-
updateIndexMetaData
- Specified by:
updateIndexMetaData
in interfaceElasticsearchClient
-
getVersionInformation
public com.fasterxml.jackson.databind.JsonNode getVersionInformation()- Specified by:
getVersionInformation
in interfaceElasticsearchClient
-
createCustomAlias
- Specified by:
createCustomAlias
in interfaceElasticsearchClient
-
createIndex
public com.fasterxml.jackson.databind.JsonNode createIndex(String indexName, String alias, 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 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
Description copied from interface:ElasticsearchClient
Creates a new alias for the given index.- Specified by:
createAliasForIndex
in interfaceElasticsearchClient
-
getAliasesForIndex
-
swapAlias
Description copied from interface:ElasticsearchClient
Swaps the alias from one index to another index.- Specified by:
swapAlias
in interfaceElasticsearchClient
-
synchronousUpsertDocumentRequest
public void synchronousUpsertDocumentRequest(String index, 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 interfaceElasticsearchClient
-
synchronousIndexDocumentRequest
public void synchronousIndexDocumentRequest(String index, String id, com.fasterxml.jackson.databind.node.ObjectNode objectNode, 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 interfaceElasticsearchClient
-
synchronousUpdateDocumentRequest
public void synchronousUpdateDocumentRequest(String index, String id, com.fasterxml.jackson.databind.node.ObjectNode objectNode, com.fasterxml.jackson.databind.node.ObjectNode scriptNode) - Specified by:
synchronousUpdateDocumentRequest
in interfaceElasticsearchClient
-
updateByQuery
- Specified by:
updateByQuery
in interfaceElasticsearchClient
-
deleteDocument
- Specified by:
deleteDocument
in interfaceElasticsearchClient
-
deleteByQuery
- Specified by:
deleteByQuery
in interfaceElasticsearchClient
-
query
public com.fasterxml.jackson.databind.JsonNode query(String index, com.fasterxml.jackson.databind.node.ObjectNode queryBody) - Specified by:
query
in interfaceElasticsearchClient
-
query
public com.fasterxml.jackson.databind.JsonNode query(String index, com.fasterxml.jackson.databind.node.ObjectNode queryBody, boolean returnVersion) -
getById
- Specified by:
getById
in interfaceElasticsearchClient
-
query
- Specified by:
query
in interfaceElasticsearchClient
-
query
-
getJsonNode
protected com.fasterxml.jackson.databind.JsonNode getJsonNode(String queryEndpoint, org.apache.http.HttpEntity entity) -
deleteIndexIfExists
- Specified by:
deleteIndexIfExists
in interfaceElasticsearchClient
-
indexExists
- Specified by:
indexExists
in interfaceElasticsearchClient
-
createAliasActionNode
-
updateAliasMapping
public void updateAliasMapping(String indexName, String aliasName, com.fasterxml.jackson.databind.JsonNode indexMapping) - Specified by:
updateAliasMapping
in interfaceElasticsearchClient
-
updateIndexMapping
public void updateIndexMapping(String indexName, com.fasterxml.jackson.databind.JsonNode mappingDelta) - Specified by:
updateIndexMapping
in interfaceElasticsearchClient
-
deleteAliasAndRelatedIndices
- Specified by:
deleteAliasAndRelatedIndices
in interfaceElasticsearchClient
-
refreshAll
protected void refreshAll() -
deleteAliasForIndex
- Specified by:
deleteAliasForIndex
in interfaceElasticsearchClient
-
refreshIndex
- Specified by:
refreshIndex
in interfaceElasticsearchClient
-
getIndexNameForAlias
- Specified by:
getIndexNameForAlias
in interfaceElasticsearchClient
-
bulkRequest
- Specified by:
bulkRequest
in interfaceElasticsearchClient
-
performRequest
protected org.elasticsearch.client.Response performRequest(org.elasticsearch.client.Request request) throws IOException - Throws:
IOException
-
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 FlowableException asFlowableException(org.elasticsearch.client.ResponseException responseException, String fallbackMessage) -
responseMessage
-