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.
  • Method Summary

    Modifier and Type Method Description
    void addToCurrentBulkRequestAsFullIndex​(org.flowable.common.engine.impl.interceptor.CommandContext commandContext, java.lang.String type, java.lang.String id, com.fasterxml.jackson.databind.node.ObjectNode data, java.lang.String idFieldName)
    Adds the ObjectNode data as a full index (i.e.
    void addToCurrentBulkRequestAsFullIndexWithExternalVersion​(org.flowable.common.engine.impl.interceptor.CommandContext commandContext, java.lang.String type, java.lang.String id, com.fasterxml.jackson.databind.node.ObjectNode data, java.lang.String idFieldName)
    Equivalent to addToCurrentBulkRequestAsFullIndex(CommandContext, String, String, ObjectNode, String), but using external versioning (vs the one from Elasticsearch).
    void addToCurrentBulkRequestAsUpsert​(org.flowable.common.engine.impl.interceptor.CommandContext commandContext, com.fasterxml.jackson.databind.node.ObjectNode data, java.lang.String idFieldName)
    Adds the ObjectNode data as an upsert (i.e.
    void addToCurrentBulkRequestAsUpsertWithScript​(org.flowable.common.engine.impl.interceptor.CommandContext commandContext, com.fasterxml.jackson.databind.node.ObjectNode dataNode, com.fasterxml.jackson.databind.node.ObjectNode scriptNode, java.lang.String idFieldName)
    Adds the ObjectNode data as an upsert (i.e.
    void deleteByQuery​(java.lang.String aliasName, com.fasterxml.jackson.databind.node.ObjectNode query)
    Delete indexed objects based on a query.
    void deleteIndexedObject​(java.lang.String aliasName, java.lang.String id)
    Delete the indexed object using the provided id.
    default void indexObject​(java.lang.Object object)
    Indexes the given object.
    void indexObject​(java.lang.Object object, java.lang.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​(org.flowable.common.engine.impl.interceptor.CommandContext commandContext, java.lang.String type, java.lang.String id)
    Returns whether a full index was already registered before during the current transaction.
    void updateByQuery​(java.lang.String mappingType, com.fasterxml.jackson.databind.node.ObjectNode data)
    Perform Update by Query for the given Mapping type.
  • Method Details

    • indexObject

      default void indexObject​(java.lang.Object object)
      Indexes the given object. If the object is a 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 data
    • indexObject

      void indexObject​(java.lang.Object object, java.lang.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.
    • deleteIndexedObject

      void deleteIndexedObject​(java.lang.String aliasName, java.lang.String id)
      Delete the indexed object using the provided id.
    • deleteByQuery

      void deleteByQuery​(java.lang.String aliasName, com.fasterxml.jackson.databind.node.ObjectNode query)
      Delete indexed objects based on a query.
    • updateByQuery

      void updateByQuery​(java.lang.String mappingType, com.fasterxml.jackson.databind.node.ObjectNode data)
      Perform Update by Query for the given Mapping type.
      Parameters:
      mappingType - the type of the mapping for which the update should be done
      data - the update by query request data
    • addToCurrentBulkRequestAsUpsert

      void addToCurrentBulkRequestAsUpsert​(org.flowable.common.engine.impl.interceptor.CommandContext commandContext, com.fasterxml.jackson.databind.node.ObjectNode data, java.lang.String idFieldName)
      Adds the 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.
    • addToCurrentBulkRequestAsFullIndex

      void addToCurrentBulkRequestAsFullIndex​(org.flowable.common.engine.impl.interceptor.CommandContext commandContext, java.lang.String type, java.lang.String id, com.fasterxml.jackson.databind.node.ObjectNode data, java.lang.String idFieldName)
      Adds the 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.
    • addToCurrentBulkRequestAsFullIndexWithExternalVersion

      void addToCurrentBulkRequestAsFullIndexWithExternalVersion​(org.flowable.common.engine.impl.interceptor.CommandContext commandContext, java.lang.String type, java.lang.String id, com.fasterxml.jackson.databind.node.ObjectNode data, java.lang.String idFieldName)
      Equivalent to addToCurrentBulkRequestAsFullIndex(CommandContext, String, String, ObjectNode, String), but using external versioning (vs the one from Elasticsearch).
    • addToCurrentBulkRequestAsUpsertWithScript

      void addToCurrentBulkRequestAsUpsertWithScript​(org.flowable.common.engine.impl.interceptor.CommandContext commandContext, com.fasterxml.jackson.databind.node.ObjectNode dataNode, com.fasterxml.jackson.databind.node.ObjectNode scriptNode, java.lang.String idFieldName)
      Adds the 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.
    • isFullIndexRegisteredOnCurrentBulkRequest

      boolean isFullIndexRegisteredOnCurrentBulkRequest​(org.flowable.common.engine.impl.interceptor.CommandContext commandContext, java.lang.String type, java.lang.String id)
      Returns whether a full index was already registered before during the current transaction. Used in conjunction with the {type, id} parameters in the addToCurrentBulkRequestAsFullIndex(CommandContext, String, String, ObjectNode, String) method.