Package com.flowable.indexing.api
Interface LowLevelIndexingService
- All Known Implementing Classes:
IndexingServiceImpl
public interface LowLevelIndexingService
Exposes low-level indexing operations.
Use the higher-level
IndexingService
when possible. Only use this when you absolutely know what you're doing.-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
Used in conjunction with #addToCurrentBulkRequestAsFullIndexWithExternalVersion to define the logic for creating the data for a new history job when a version conflict happens. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addToCurrentBulkRequestAsFullIndex
(CommandContext commandContext, String type, String id, com.fasterxml.jackson.databind.node.ObjectNode data, String idFieldName) Adds theObjectNode
data as a full index (i.e.void
addToCurrentBulkRequestAsFullIndexWithExternalVersion
(CommandContext commandContext, String type, String id, com.fasterxml.jackson.databind.node.ObjectNode data, String idFieldName, LowLevelIndexingService.BulkIndexRequestConflictHandler bulkIndexRequestConflictHandler) Equivalent toaddToCurrentBulkRequestAsFullIndex(CommandContext, String, String, ObjectNode, String)
, but using external versioning (vs the one from Elasticsearch).void
addToCurrentBulkRequestAsUpsert
(CommandContext commandContext, String type, com.fasterxml.jackson.databind.node.ObjectNode data, String idFieldName) Adds theObjectNode
data as an upsert (i.e.void
addToCurrentBulkRequestAsUpsertWithScript
(CommandContext commandContext, com.fasterxml.jackson.databind.node.ObjectNode dataNode, com.fasterxml.jackson.databind.node.ObjectNode scriptNode, String idFieldName) Adds theObjectNode
data as an upsert (i.e.void
deleteByQuery
(String aliasName, com.fasterxml.jackson.databind.node.ObjectNode query) Delete indexed objects based on a query.void
deleteIndexedObject
(String aliasName, String id) Delete the indexed object using the provided id.default void
indexObject
(Object object) Deprecated.void
indexObject
(Object object, String idFieldName) Deprecated.boolean
isFullIndexRegisteredOnCurrentBulkRequest
(CommandContext commandContext, String type, String id) Returns whether a full index was already registered before during the current transaction.void
updateByQuery
(String mappingType, com.fasterxml.jackson.databind.node.ObjectNode data) Perform Update by Query for the given Mapping type.
-
Method Details
-
indexObject
Deprecated.Indexes the given object. If the object is aJsonNode
, no serialization will happen. Register a customObjectSerializationService
to have custom object serialization. Followings the following pattern for choosing how to index: - If the object has a script, do an update with a script - Otherwise, do an upsert update with the provided data Deprecated: This method will be removed in a future version. -
indexObject
Deprecated.Similar toindexObject(Object)
, but by providing an alternative field name that contains the id, instead of depending on theIndexingJsonConstants.PROPERTY_ID
in the json. Deprecated: This method will be removed in a future version. -
deleteIndexedObject
Delete the indexed object using the provided id. -
deleteByQuery
Delete indexed objects based on a query. -
updateByQuery
Perform Update by Query for the given Mapping type.- Parameters:
mappingType
- the type of the mapping for which the update should be donedata
- the update by query request data
-
addToCurrentBulkRequestAsUpsert
void addToCurrentBulkRequestAsUpsert(CommandContext commandContext, String type, com.fasterxml.jackson.databind.node.ObjectNode data, String idFieldName) Adds theObjectNode
data as an upsert (i.e. merge if exist, insert if not) to the current bulk request (or creates a bulk request if needed). The bulk request is executed at the end of the transactions, when all items for indexing have been added. -
addToCurrentBulkRequestAsFullIndex
void addToCurrentBulkRequestAsFullIndex(CommandContext commandContext, String type, String id, com.fasterxml.jackson.databind.node.ObjectNode data, String idFieldName) Adds theObjectNode
data as a full index (i.e. replace the current indexed document if any exists) to the current bulk request (or creates a bulk request if needed). The bulk request is executed at the end of the transactions, when all items for indexing have been added. The {type, id} parameters are not used during indexing, but is registered internally and can be used to check whether indexing was already triggered via theisFullIndexRegisteredOnCurrentBulkRequest(CommandContext, String, String)
method. This allows to avoid costly recalculation of data or doing the same indexing operation multiple times in ES. Note that this method doesn't apply that check automatically, and the caller is responsible for calling it. -
addToCurrentBulkRequestAsFullIndexWithExternalVersion
void addToCurrentBulkRequestAsFullIndexWithExternalVersion(CommandContext commandContext, String type, String id, com.fasterxml.jackson.databind.node.ObjectNode data, String idFieldName, LowLevelIndexingService.BulkIndexRequestConflictHandler bulkIndexRequestConflictHandler) Equivalent toaddToCurrentBulkRequestAsFullIndex(CommandContext, String, String, ObjectNode, String)
, but using external versioning (vs the one from Elasticsearch). -
addToCurrentBulkRequestAsUpsertWithScript
void addToCurrentBulkRequestAsUpsertWithScript(CommandContext commandContext, com.fasterxml.jackson.databind.node.ObjectNode dataNode, com.fasterxml.jackson.databind.node.ObjectNode scriptNode, String idFieldName) Adds theObjectNode
data as an upsert (i.e. merge if exist, insert if not) using an update script to the current bulk request (or creates a bulk request if needed). The bulk request is executed at the end of the transactions, when all items for indexing have been added. -
isFullIndexRegisteredOnCurrentBulkRequest
boolean isFullIndexRegisteredOnCurrentBulkRequest(CommandContext commandContext, String type, String id) Returns whether a full index was already registered before during the current transaction. Used in conjunction with the {type, id} parameters in theaddToCurrentBulkRequestAsFullIndex(CommandContext, String, String, ObjectNode, String)
method.
-