Interface PojoIndexer
public interface PojoIndexer
An interface for indexing entities in the context of a session in a POJO mapper,
immediately, asynchronously and without any sort of
planning
or handling of containing entities.
Implementations must be thread-safe if the underlying session is thread-safe.
-
Method Summary
Modifier and TypeMethodDescriptiondefault CompletableFuture
<?> add
(PojoRawTypeIdentifier<?> typeIdentifier, Object providedId, DocumentRoutesDescriptor providedRoutes, Object entity, DocumentCommitStrategy commitStrategy, DocumentRefreshStrategy refreshStrategy) Deprecated.add
(PojoRawTypeIdentifier<?> typeIdentifier, Object providedId, DocumentRoutesDescriptor providedRoutes, Object entity, DocumentCommitStrategy commitStrategy, DocumentRefreshStrategy refreshStrategy, OperationSubmitter operationSubmitter) Add an entity to the index, assuming that the entity is absent from the index.default CompletableFuture
<?> addOrUpdate
(PojoRawTypeIdentifier<?> typeIdentifier, Object providedId, DocumentRoutesDescriptor providedRoutes, Object entity, DocumentCommitStrategy commitStrategy, DocumentRefreshStrategy refreshStrategy) addOrUpdate
(PojoRawTypeIdentifier<?> typeIdentifier, Object providedId, DocumentRoutesDescriptor providedRoutes, Object entity, DocumentCommitStrategy commitStrategy, DocumentRefreshStrategy refreshStrategy, OperationSubmitter operationSubmitter) Update an entity in the index, or add it if it's absent from the index.default CompletableFuture
<?> delete
(PojoRawTypeIdentifier<?> typeIdentifier, Object providedId, DocumentRoutesDescriptor providedRoutes, Object entity, DocumentCommitStrategy commitStrategy, DocumentRefreshStrategy refreshStrategy) delete
(PojoRawTypeIdentifier<?> typeIdentifier, Object providedId, DocumentRoutesDescriptor providedRoutes, Object entity, DocumentCommitStrategy commitStrategy, DocumentRefreshStrategy refreshStrategy, OperationSubmitter operationSubmitter) Delete an entity from the index.default CompletableFuture
<?> delete
(PojoRawTypeIdentifier<?> typeIdentifier, Object providedId, DocumentRoutesDescriptor providedRoutes, DocumentCommitStrategy commitStrategy, DocumentRefreshStrategy refreshStrategy) delete
(PojoRawTypeIdentifier<?> typeIdentifier, Object providedId, DocumentRoutesDescriptor providedRoutes, DocumentCommitStrategy commitStrategy, DocumentRefreshStrategy refreshStrategy, OperationSubmitter operationSubmitter) Purge an entity from the index.
-
Method Details
-
add
CompletableFuture<?> add(PojoRawTypeIdentifier<?> typeIdentifier, Object providedId, DocumentRoutesDescriptor providedRoutes, Object entity, DocumentCommitStrategy commitStrategy, DocumentRefreshStrategy refreshStrategy, OperationSubmitter operationSubmitter) Add an entity to the index, assuming that the entity is absent from the index.Entities to reindex as a result of this operation will not be resolved.
Note: depending on the backend, this may lead to errors or duplicate entries in the index if the entity was actually already present in the index before this call.
- Parameters:
typeIdentifier
- The identifier of the entity type.providedId
- A value to extract the document ID from. Generally the expected value is the entity ID, but a different value may be expected depending on the mapping. Ifnull
, Hibernate Search will attempt to extract the ID from the entity.providedRoutes
- The route to the current index shard. Leavenull
if sharding is disabled or to have Hibernate Search compute the value through the assignedRoutingBridge
.entity
- The entity to add to the index.commitStrategy
- How to handle the commit.refreshStrategy
- How to handle the refresh.operationSubmitter
- How to handle request to submit operation when the queue is full- Returns:
- A
CompletableFuture
reflecting the completion state of the operation.
-
add
@Deprecated default CompletableFuture<?> add(PojoRawTypeIdentifier<?> typeIdentifier, Object providedId, DocumentRoutesDescriptor providedRoutes, Object entity, DocumentCommitStrategy commitStrategy, DocumentRefreshStrategy refreshStrategy) Deprecated.- See Also:
-
addOrUpdate
CompletableFuture<?> addOrUpdate(PojoRawTypeIdentifier<?> typeIdentifier, Object providedId, DocumentRoutesDescriptor providedRoutes, Object entity, DocumentCommitStrategy commitStrategy, DocumentRefreshStrategy refreshStrategy, OperationSubmitter operationSubmitter) Update an entity in the index, or add it if it's absent from the index.Entities to reindex as a result of this operation will not be resolved.
- Parameters:
typeIdentifier
- The identifier of the entity type.providedId
- A value to extract the document ID from. Generally the expected value is the entity ID, but a different value may be expected depending on the mapping. Ifnull
, Hibernate Search will attempt to extract the ID from the entity.providedRoutes
- The routes to the current and previous index shards. Leavenull
if sharding is disabled or to have Hibernate Search compute the value through the assignedRoutingBridge
.entity
- The entity to update in the index.commitStrategy
- How to handle the commit.refreshStrategy
- How to handle the refresh.operationSubmitter
- How to handle request to submit operation when the queue is full- Returns:
- A
CompletableFuture
reflecting the completion state of the operation.
-
addOrUpdate
@Deprecated default CompletableFuture<?> addOrUpdate(PojoRawTypeIdentifier<?> typeIdentifier, Object providedId, DocumentRoutesDescriptor providedRoutes, Object entity, DocumentCommitStrategy commitStrategy, DocumentRefreshStrategy refreshStrategy) Deprecated.- See Also:
-
delete
CompletableFuture<?> delete(PojoRawTypeIdentifier<?> typeIdentifier, Object providedId, DocumentRoutesDescriptor providedRoutes, Object entity, DocumentCommitStrategy commitStrategy, DocumentRefreshStrategy refreshStrategy, OperationSubmitter operationSubmitter) Delete an entity from the index.Entities to reindex as a result of this operation will not be resolved.
No effect on the index if the entity is not in the index.
- Parameters:
typeIdentifier
- The identifier of the entity type.providedId
- A value to extract the document ID from. Generally the expected value is the entity ID, but a different value may be expected depending on the mapping. Ifnull
, Hibernate Search will attempt to extract the ID from the entity.providedRoutes
- The routes to the current and previous index shards. Leavenull
if sharding is disabled or to have Hibernate Search compute the value through the assignedRoutingBridge
.entity
- The entity to delete from the index.commitStrategy
- How to handle the commit.refreshStrategy
- How to handle the refresh.operationSubmitter
- How to handle request to submit operation when the queue is full- Returns:
- A
CompletableFuture
reflecting the completion state of the operation.
-
delete
@Deprecated default CompletableFuture<?> delete(PojoRawTypeIdentifier<?> typeIdentifier, Object providedId, DocumentRoutesDescriptor providedRoutes, Object entity, DocumentCommitStrategy commitStrategy, DocumentRefreshStrategy refreshStrategy) Deprecated.- See Also:
-
delete
CompletableFuture<?> delete(PojoRawTypeIdentifier<?> typeIdentifier, Object providedId, DocumentRoutesDescriptor providedRoutes, DocumentCommitStrategy commitStrategy, DocumentRefreshStrategy refreshStrategy, OperationSubmitter operationSubmitter) Purge an entity from the index.Entities to reindex as a result of this operation will not be resolved.
No effect on the index if the entity is not in the index.
- Parameters:
typeIdentifier
- The identifier of the entity type.providedId
- A value to extract the document ID from.providedRoutes
- The routes to the current and previous index shards. Leavenull
if sharding is disabled or to have Hibernate Search compute the value through the assignedRoutingBridge
.commitStrategy
- How to handle the commit.refreshStrategy
- How to handle the refresh.operationSubmitter
- How to handle request to submit operation when the queue is full- Returns:
- A
CompletableFuture
reflecting the completion state of the operation.
-
delete
@Deprecated default CompletableFuture<?> delete(PojoRawTypeIdentifier<?> typeIdentifier, Object providedId, DocumentRoutesDescriptor providedRoutes, DocumentCommitStrategy commitStrategy, DocumentRefreshStrategy refreshStrategy) Deprecated.- See Also:
-
add(PojoRawTypeIdentifier, Object, DocumentRoutesDescriptor, Object, DocumentCommitStrategy, DocumentRefreshStrategy, OperationSubmitter)
instead.