Package com.flowable.indexing
Class ElasticsearchClientImpl
java.lang.Object
com.flowable.indexing.ElasticsearchClientImpl
- All Implemented Interfaces:
ElasticsearchClient
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface com.flowable.indexing.ElasticsearchClient
ElasticsearchClient.BulkRequestClient -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.elasticsearch.client.RequestOptionsprotected ElasticsearchCompatibilityprotected static final Stringprotected com.fasterxml.jackson.databind.ObjectMapperprotected org.elasticsearch.client.RestClient -
Constructor Summary
ConstructorsConstructorDescriptionElasticsearchClientImpl(org.elasticsearch.client.RestClient restClient, com.fasterxml.jackson.databind.ObjectMapper objectMapper, ElasticsearchCompatibility elasticsearchCompatibility, org.elasticsearch.client.RequestOptions defaultRequestOptions) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddIncludeTypeNameParameterIfNeeded(org.elasticsearch.client.Request request) protected FlowableExceptionasFlowableException(org.elasticsearch.client.ResponseException responseException, String fallbackMessage) protected com.fasterxml.jackson.databind.node.ObjectNodecreateAliasActionNode(String indexName, String aliasName, String action, com.fasterxml.jackson.databind.JsonNode filter) voidcreateAliasForIndex(String alias, String index) Creates a new alias for the given index.voidcreateCustomAlias(String alias, String indexMapping) com.fasterxml.jackson.databind.JsonNodecreateIndex(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.voidvoiddeleteAliasForIndex(String alias, String index) voiddeleteByQuery(String index, com.fasterxml.jackson.databind.node.ObjectNode requestNode) voiddeleteDocument(String alias, String id) voiddeleteIndexIfExists(String index) protected com.fasterxml.jackson.databind.JsonNodegetAliasesForIndex(String index) com.fasterxml.jackson.databind.JsonNodecom.fasterxml.jackson.databind.JsonNodegetIndexCurrentMapping(String index) com.fasterxml.jackson.databind.JsonNodegetIndexCurrentSettings(String index) getIndexNameForAlias(String alias) protected com.fasterxml.jackson.databind.JsonNodegetJsonNode(String queryEndpoint, org.apache.http.HttpEntity entity) com.fasterxml.jackson.databind.ObjectMappercom.fasterxml.jackson.databind.JsonNodebooleanindexExists(String index) protected org.elasticsearch.client.ResponseperformRequest(org.elasticsearch.client.Request request) com.fasterxml.jackson.databind.JsonNodecom.fasterxml.jackson.databind.JsonNodequery(String index, com.fasterxml.jackson.databind.node.ObjectNode queryBody, boolean returnVersion) com.fasterxml.jackson.databind.JsonNodecom.fasterxml.jackson.databind.JsonNodeprotected voidvoidrefreshIndex(String index) protected StringresponseMessage(org.elasticsearch.client.Response response, String fallbackMessage) com.fasterxml.jackson.databind.JsonNodesetIndexSettings(String index, com.fasterxml.jackson.databind.node.ObjectNode settings) voidsetObjectMapper(com.fasterxml.jackson.databind.ObjectMapper objectMapper) voidSwaps the alias from one index to another index.voidsynchronousIndexDocumentRequest(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.voidsynchronousUpdateDocumentRequest(String index, String id, com.fasterxml.jackson.databind.node.ObjectNode objectNode, com.fasterxml.jackson.databind.node.ObjectNode scriptNode) voidsynchronousUpsertDocumentRequest(String index, String id, com.fasterxml.jackson.databind.node.ObjectNode objectNode) Indexes a document using an upsert queryvoidupdateAliasMapping(String indexName, String aliasName, com.fasterxml.jackson.databind.JsonNode indexMapping) voidupdateByQuery(String index, com.fasterxml.jackson.databind.node.ObjectNode requestNode) voidupdateIndexMapping(String indexName, com.fasterxml.jackson.databind.JsonNode mappingDelta) voidupdateIndexMetaData(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:
getIndexCurrentMappingin interfaceElasticsearchClient
-
getIndexCurrentSettings
- Specified by:
getIndexCurrentSettingsin interfaceElasticsearchClient
-
setIndexSettings
public com.fasterxml.jackson.databind.JsonNode setIndexSettings(String index, com.fasterxml.jackson.databind.node.ObjectNode settings) - Specified by:
setIndexSettingsin interfaceElasticsearchClient
-
updateIndexMetaData
- Specified by:
updateIndexMetaDatain interfaceElasticsearchClient
-
getVersionInformation
public com.fasterxml.jackson.databind.JsonNode getVersionInformation()- Specified by:
getVersionInformationin interfaceElasticsearchClient
-
createCustomAlias
- Specified by:
createCustomAliasin interfaceElasticsearchClient
-
createIndex
public com.fasterxml.jackson.databind.JsonNode createIndex(String indexName, String alias, 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
Description copied from interface:ElasticsearchClientCreates a new alias for the given index.- Specified by:
createAliasForIndexin interfaceElasticsearchClient
-
getAliasesForIndex
-
swapAlias
Description copied from interface:ElasticsearchClientSwaps the alias from one index to another index.- Specified by:
swapAliasin interfaceElasticsearchClient
-
synchronousUpsertDocumentRequest
public void synchronousUpsertDocumentRequest(String index, 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(String index, String id, com.fasterxml.jackson.databind.node.ObjectNode objectNode, 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(String index, String id, com.fasterxml.jackson.databind.node.ObjectNode objectNode, com.fasterxml.jackson.databind.node.ObjectNode scriptNode) - Specified by:
synchronousUpdateDocumentRequestin interfaceElasticsearchClient
-
updateByQuery
- Specified by:
updateByQueryin interfaceElasticsearchClient
-
deleteDocument
- Specified by:
deleteDocumentin interfaceElasticsearchClient
-
deleteByQuery
- Specified by:
deleteByQueryin interfaceElasticsearchClient
-
query
public com.fasterxml.jackson.databind.JsonNode query(String index, com.fasterxml.jackson.databind.node.ObjectNode queryBody) - Specified by:
queryin interfaceElasticsearchClient
-
query
public com.fasterxml.jackson.databind.JsonNode query(String index, com.fasterxml.jackson.databind.node.ObjectNode queryBody, boolean returnVersion) -
getById
- Specified by:
getByIdin interfaceElasticsearchClient
-
query
- Specified by:
queryin interfaceElasticsearchClient
-
query
-
getJsonNode
protected com.fasterxml.jackson.databind.JsonNode getJsonNode(String queryEndpoint, org.apache.http.HttpEntity entity) -
deleteIndexIfExists
- Specified by:
deleteIndexIfExistsin interfaceElasticsearchClient
-
indexExists
- Specified by:
indexExistsin interfaceElasticsearchClient
-
createAliasActionNode
-
updateAliasMapping
public void updateAliasMapping(String indexName, String aliasName, com.fasterxml.jackson.databind.JsonNode indexMapping) - Specified by:
updateAliasMappingin interfaceElasticsearchClient
-
updateIndexMapping
public void updateIndexMapping(String indexName, com.fasterxml.jackson.databind.JsonNode mappingDelta) - Specified by:
updateIndexMappingin interfaceElasticsearchClient
-
deleteAliasAndRelatedIndices
- Specified by:
deleteAliasAndRelatedIndicesin interfaceElasticsearchClient
-
refreshAll
protected void refreshAll() -
deleteAliasForIndex
- Specified by:
deleteAliasForIndexin interfaceElasticsearchClient
-
refreshIndex
- Specified by:
refreshIndexin interfaceElasticsearchClient
-
getIndexNameForAlias
- Specified by:
getIndexNameForAliasin interfaceElasticsearchClient
-
bulkRequest
- Specified by:
bulkRequestin 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
-