Interface IBigDataIndexer

  • All Known Subinterfaces:
    IBatchIndexer, IBigDataRepository, IBigDataRepositorySPI
    All Known Implementing Classes:
    ElasticsearchRepository

    @StableMinor(version="16.0",
                 sinceVersion="8.1")
    public interface IBigDataIndexer
    Provides big data indexing operations.
    Unless specified, the indexing operations may be asynchronous. Hence, the indexing actions may not be available just after the action has been called, and there's no guarantee the requested actions will, indeed, be succeeded.
    Since:
    8.1.0
    Version:
    $Revision: 25808 $ $Date: 2023-07-04 15:20:55 -0300 (Tue, 04 Jul 2023) $
    • Method Detail

      • addDocument

        void addDocument​(Document document)
        Adds a document to the index. If in the index already exists a document with the same document type, identifier and locale then this operation will fail (probably without throwing any exception, since the fail may occur in background as this method may be asynchronous).
        Parameters:
        document - the document to be added.
        Since:
        8.1.0
        See Also:
        addOrUpdateDocument(Document)
      • addOrUpdateDocument

        void addOrUpdateDocument​(Document document)
        Adds or updates a document on the index. If in the index already exists a document with the same document type, identifier and locale then the document on the index will be replaced by the given document; otherwise the given document will be added to the index.
        Parameters:
        document - the document to be added.
        Since:
        11.0.0
        See Also:
        addDocument(Document)
      • deleteDocument

        void deleteDocument​(DocumentType documentType,
                            java.util.Locale locale,
                            java.lang.String documentId)
        Deletes a document from the index with the given specifications. If no such document exists, this method does nothing.
        Parameters:
        documentType - the document's type.
        locale - the document's locale as set in its standard locale field. Must be null if the document does not have a locale specified.
        documentId - the document's identifier.
        Since:
        11.0.0
      • deleteDocumentsByFieldValue

        void deleteDocumentsByFieldValue​(java.lang.String fieldId,
                                         java.lang.Object... values)
        Deletes documents that are matched by one of the given values in the field of given field identifier.
        Parameters:
        fieldId - the field identifier.
        values - the values.
        Since:
        8.1.0
      • deleteDocumentsByFieldValue

        void deleteDocumentsByFieldValue​(java.lang.String fieldId,
                                         java.util.Collection<?> values)
        Deletes documents that are matched by one of the given values in the field of given field identifier.
        Parameters:
        fieldId - the field identifier.
        values - the values.
        Since:
        8.1.0
      • deleteDocumentsByQuery

        void deleteDocumentsByQuery​(SearchQuery searchQuery)
        Deletes documents that are matched by the given search query.
        The search query's sorts, initial hit and maximum hit count will be ignored.
        Parameters:
        searchQuery - the search query.
        Since:
        8.1.0
      • updateDocumentsByQuerySync

        void updateDocumentsByQuerySync​(SearchQuery searchQuery,
                                        java.util.Map<java.lang.String,​java.lang.Object> fieldValues)
        Updates documents that matches a SearchQuery updating their field values according to the fieldValues map.

        This operation is synchronous in relation to the completion of the update execution. Searches performed after this method returns may not reflect the update, since internal optimizations and behavior of the underlying big data storage may demand some time for the update to be visible to searches.

        Parameters:
        searchQuery - the search query.
        fieldValues - a map where the key is a field's full identifier and the value is the value to be set on the corresponding field. The value must be of a type compatible with the field type. If the value is null,
        Since:
        11.0.0