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 Detail

      • indexObject

        default void indexObject​(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
      • 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,
                                             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.
      • 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.