Class PojoIndexerImpl
java.lang.Object
org.hibernate.search.mapper.pojo.work.impl.PojoIndexerImpl
- All Implemented Interfaces:
PojoIndexer
-
Constructor Summary
ConstructorsConstructorDescriptionPojoIndexerImpl(PojoWorkTypeContextProvider typeContextProvider, PojoWorkSessionContext sessionContext) -
Method Summary
Modifier and TypeMethodDescriptionadd(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.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.delete(PojoRawTypeIdentifier<?> typeIdentifier, Object providedId, DocumentRoutesDescriptor providedRoutes, Object entity, DocumentCommitStrategy commitStrategy, DocumentRefreshStrategy refreshStrategy, OperationSubmitter operationSubmitter) Delete an entity from the index.delete(PojoRawTypeIdentifier<?> typeIdentifier, Object providedId, DocumentRoutesDescriptor providedRoutes, DocumentCommitStrategy commitStrategy, DocumentRefreshStrategy refreshStrategy, OperationSubmitter operationSubmitter) Purge an entity from the index.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.hibernate.search.mapper.pojo.work.spi.PojoIndexer
add, addOrUpdate, delete, delete
-
Constructor Details
-
PojoIndexerImpl
public PojoIndexerImpl(PojoWorkTypeContextProvider typeContextProvider, PojoWorkSessionContext sessionContext)
-
-
Method Details
-
add
public CompletableFuture<?> add(PojoRawTypeIdentifier<?> typeIdentifier, Object providedId, DocumentRoutesDescriptor providedRoutes, Object entity, DocumentCommitStrategy commitStrategy, DocumentRefreshStrategy refreshStrategy, OperationSubmitter operationSubmitter) Description copied from interface:PojoIndexerAdd 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.
- Specified by:
addin interfacePojoIndexer- 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. Leavenullif 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
CompletableFuturereflecting the completion state of the operation.
-
addOrUpdate
public CompletableFuture<?> addOrUpdate(PojoRawTypeIdentifier<?> typeIdentifier, Object providedId, DocumentRoutesDescriptor providedRoutes, Object entity, DocumentCommitStrategy commitStrategy, DocumentRefreshStrategy refreshStrategy, OperationSubmitter operationSubmitter) Description copied from interface:PojoIndexerUpdate 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.
- Specified by:
addOrUpdatein interfacePojoIndexer- 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. Leavenullif 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
CompletableFuturereflecting the completion state of the operation.
-
delete
public CompletableFuture<?> delete(PojoRawTypeIdentifier<?> typeIdentifier, Object providedId, DocumentRoutesDescriptor providedRoutes, Object entity, DocumentCommitStrategy commitStrategy, DocumentRefreshStrategy refreshStrategy, OperationSubmitter operationSubmitter) Description copied from interface:PojoIndexerDelete 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.
- Specified by:
deletein interfacePojoIndexer- 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. Leavenullif 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
CompletableFuturereflecting the completion state of the operation.
-
delete
public CompletableFuture<?> delete(PojoRawTypeIdentifier<?> typeIdentifier, Object providedId, DocumentRoutesDescriptor providedRoutes, DocumentCommitStrategy commitStrategy, DocumentRefreshStrategy refreshStrategy, OperationSubmitter operationSubmitter) Description copied from interface:PojoIndexerPurge 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.
- Specified by:
deletein interfacePojoIndexer- 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. Leavenullif 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
CompletableFuturereflecting the completion state of the operation.
-