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 Details

    • indexObject

      @Deprecated default void indexObject(Object object)
      Deprecated.
      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 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 void indexObject(Object object, String idFieldName)
      Deprecated.
      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. Deprecated: This method will be removed in a future version.
    • deleteIndexedObject

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

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

      void updateByQuery(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(CommandContext commandContext, String type, com.fasterxml.jackson.databind.node.ObjectNode data, 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(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. 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(CommandContext commandContext, String type, String id, com.fasterxml.jackson.databind.node.ObjectNode data, String idFieldName, LowLevelIndexingService.BulkIndexRequestConflictHandler bulkIndexRequestConflictHandler)
      Equivalent to addToCurrentBulkRequestAsFullIndex(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 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(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 the addToCurrentBulkRequestAsFullIndex(CommandContext, String, String, ObjectNode, String) method.