java.lang.Object
io.fluxzero.sdk.persisting.search.DefaultIndexOperation
- All Implemented Interfaces:
IndexOperation
Default implementation of the
IndexOperation interface.
This class provides a mutable, builder-style implementation for preparing and executing document indexing operations
using a DocumentStore.
Instances of this class are typically created by calling DocumentStore.prepareIndex(Object). Upon
construction, the document ID, collection name, and timestamps are automatically extracted from the object's class
using reflection.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncopy()Creates a deep copy of this operation, preserving all configured values.index(io.fluxzero.common.Guarantee guarantee) Executes the indexing operation with the provided guarantee.static DefaultIndexOperationprepare(DocumentStore documentStore, @NonNull Object object) Prepare a newDefaultIndexOperationinstance for managing document indexing.static DefaultIndexOperationprepare(DocumentStore documentStore, Object object, @NonNull Object collection, String idPath, String beginPath, String endPath) static DefaultIndexOperationprepare(DocumentStore documentStore, Object object, @NonNull Object collection, Function<Object, ?> idFunction, Function<Object, Instant> beginFunction, Function<Object, Instant> endFunction) io.fluxzero.common.api.search.SerializedDocumentConverts the current state of the IndexOperation into a Document instance.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.fluxzero.sdk.persisting.search.IndexOperation
addMetadata, addMetadata, addMetadata, collection, end, end, id, id, ifNotExists, ifNotExists, index, indexAndForget, indexAndWait, indexAndWait, metadata, metadata, period, start, start, timestamp
-
Constructor Details
-
DefaultIndexOperation
public DefaultIndexOperation()
-
-
Method Details
-
prepare
public static DefaultIndexOperation prepare(DocumentStore documentStore, @NonNull @NonNull Object object) Prepare a newDefaultIndexOperationinstance for managing document indexing.- Parameters:
documentStore- theDocumentStoreused to store and manage the index operationsobject- the object to be indexed, which will be analyzed and converted for storage- Returns:
- an index operation initialized for the given object
-
prepare
public static DefaultIndexOperation prepare(DocumentStore documentStore, Object object, @NonNull @NonNull Object collection, String idPath, String beginPath, String endPath) -
prepare
-
index
Description copied from interface:IndexOperationExecutes the indexing operation with the provided guarantee.- Specified by:
indexin interfaceIndexOperation
-
toDocument
public io.fluxzero.common.api.search.SerializedDocument toDocument()Description copied from interface:IndexOperationConverts the current state of the IndexOperation into a Document instance.- Specified by:
toDocumentin interfaceIndexOperation
-
copy
Description copied from interface:IndexOperationCreates a deep copy of this operation, preserving all configured values.- Specified by:
copyin interfaceIndexOperation
-