public interface LowLevelIndexingService
IndexingService
when possible. Only use this when you absolutely know what you're doing.Modifier and Type | Method and Description |
---|---|
void |
addToCurrentBulkRequestAsFullIndex(CommandContext commandContext,
String type,
String id,
com.fasterxml.jackson.databind.node.ObjectNode data,
String idFieldName)
Adds the
ObjectNode data as a full index (i.e. |
void |
addToCurrentBulkRequestAsFullIndexWithExternalVersion(CommandContext commandContext,
String type,
String id,
com.fasterxml.jackson.databind.node.ObjectNode data,
String idFieldName)
Equivalent to
addToCurrentBulkRequestAsFullIndex(CommandContext, String, String, ObjectNode, String) ,
but using external versioning (vs the one from Elasticsearch). |
void |
addToCurrentBulkRequestAsUpsert(CommandContext commandContext,
com.fasterxml.jackson.databind.node.ObjectNode data,
String idFieldName)
Adds the
ObjectNode 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 the
ObjectNode 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)
Indexes the given object.
|
void |
indexObject(Object object,
String idFieldName)
Similar to
indexObject(Object) , but by providing an alternative field name that contains the id,
instead of depending on the IndexingJsonConstants.PROPERTY_ID in the json. |
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.
|
default void indexObject(Object object)
JsonNode
, no serialization will happen.
Register a custom ObjectSerializationService
to have custom object serialization.
Followings the following pattern for choosing how to index:
- If the object has an external version, index it
- If the object has a script, do an update with a script
- Otherwise, do an upsert update with the provided datavoid indexObject(Object object, String idFieldName)
indexObject(Object)
, but by providing an alternative field name that contains the id,
instead of depending on the IndexingJsonConstants.PROPERTY_ID
in the json.void deleteIndexedObject(String aliasName, String id)
void deleteByQuery(String aliasName, com.fasterxml.jackson.databind.node.ObjectNode query)
void updateByQuery(String mappingType, com.fasterxml.jackson.databind.node.ObjectNode data)
mappingType
- the type of the mapping for which the update should be donedata
- the update by query request datavoid addToCurrentBulkRequestAsUpsert(CommandContext commandContext, com.fasterxml.jackson.databind.node.ObjectNode data, String idFieldName)
ObjectNode
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.void addToCurrentBulkRequestAsFullIndex(CommandContext commandContext, String type, String id, com.fasterxml.jackson.databind.node.ObjectNode data, String idFieldName)
ObjectNode
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 the isFullIndexRegisteredOnCurrentBulkRequest(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.void addToCurrentBulkRequestAsFullIndexWithExternalVersion(CommandContext commandContext, String type, String id, com.fasterxml.jackson.databind.node.ObjectNode data, String idFieldName)
addToCurrentBulkRequestAsFullIndex(CommandContext, String, String, ObjectNode, String)
,
but using external versioning (vs the one from Elasticsearch).void addToCurrentBulkRequestAsUpsertWithScript(CommandContext commandContext, com.fasterxml.jackson.databind.node.ObjectNode dataNode, com.fasterxml.jackson.databind.node.ObjectNode scriptNode, String idFieldName)
ObjectNode
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.boolean isFullIndexRegisteredOnCurrentBulkRequest(CommandContext commandContext, String type, String id)
addToCurrentBulkRequestAsFullIndex(CommandContext, String, String, ObjectNode, String)
method.