Interface SearchIndexer
This class is stateless: operations start executing as soon as they are submitted.
This contract is thread-safe.
-
Method Summary
Modifier and TypeMethodDescriptionadd
(Class<?> entityClass, Object providedId, DocumentRoutesDescriptor providedRoutes) Add an entity to the index, assuming that the entity is absent from the index.default CompletionStage
<?> Add an entity to the index, assuming that the entity is absent from the index.default CompletionStage
<?> Add an entity to the index, assuming that the entity is absent from the index.add
(Object providedId, DocumentRoutesDescriptor providedRoutes, Object entity) Add an entity to the index, assuming that the entity is absent from the index.addOrUpdate
(Class<?> entityClass, Object providedId, DocumentRoutesDescriptor providedRoutes) Update an entity in the index, or add it if it's absent from the index.default CompletionStage
<?> addOrUpdate
(Object entity) Update an entity in the index, or add it if it's absent from the index.default CompletionStage
<?> addOrUpdate
(Object providedId, Object entity) Update an entity in the index, or add it if it's absent from the index.addOrUpdate
(Object providedId, DocumentRoutesDescriptor providedRoutes, Object entity) Update an entity in the index, or add it if it's absent from the index.delete
(Class<?> entityClass, Object providedId, DocumentRoutesDescriptor providedRoutes) Purge an entity from the index.default CompletionStage
<?> Delete an entity from the index.default CompletionStage
<?> Delete an entity from the index.delete
(Object providedId, DocumentRoutesDescriptor providedRoutes, Object entity) Delete an entity from the index.
-
Method Details
-
add
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.
Shorthand for
add(null, null, entity)
; seeadd(Object, DocumentRoutesDescriptor, Object)
.- Parameters:
entity
- The entity to add to the index.- Returns:
- A
CompletionStage
reflecting the completion state of the operation.
-
add
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.
Shorthand for
add(providedId, null, entity)
; seeadd(Object, DocumentRoutesDescriptor, Object)
.- Parameters:
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.entity
- The entity to add to the index.- Returns:
- A
CompletionStage
reflecting the completion state of the operation.
-
add
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:
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.- Returns:
- A
CompletionStage
reflecting the completion state of the operation.
-
add
CompletionStage<?> add(Class<?> entityClass, Object providedId, DocumentRoutesDescriptor providedRoutes) 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:
entityClass
- The class of the entity to add to the index.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.providedRoutes
- The route to the current index shard. Leavenull
if sharding is disabled or if you don't use a customRoutingBridge
.- Returns:
- A
CompletionStage
reflecting the completion state of the operation.
-
addOrUpdate
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.
Shorthand for
addOrUpdate(null, null, entity)
; seeaddOrUpdate(Object, DocumentRoutesDescriptor, Object)
.- Parameters:
entity
- The entity to add to the index.- Returns:
- A
CompletionStage
reflecting the completion state of the operation.
-
addOrUpdate
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.
Shorthand for
addOrUpdate(providedId, null, entity)
; seeaddOrUpdate(Object, DocumentRoutesDescriptor, Object)
.- Parameters:
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.entity
- The entity to update in the index.- Returns:
- A
CompletionStage
reflecting the completion state of the operation.
-
addOrUpdate
CompletionStage<?> addOrUpdate(Object providedId, DocumentRoutesDescriptor providedRoutes, Object entity) 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:
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.- Returns:
- A
CompletionStage
reflecting the completion state of the operation.
-
addOrUpdate
CompletionStage<?> addOrUpdate(Class<?> entityClass, Object providedId, DocumentRoutesDescriptor providedRoutes) 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:
entityClass
- The class of the entity to update in the index.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.providedRoutes
- The routes to the current and previous index shards. Leavenull
if sharding is disabled Leavenull
if sharding is disabled or if you don't use a customRoutingBridge
.- Returns:
- A
CompletionStage
reflecting the completion state of the operation.
-
delete
Delete an entity from the index.Entities to reindex as a result of this operation will not be resolved.
Shorthand for
delete(null, null, entity)
; seedelete(Object, DocumentRoutesDescriptor, Object)
.- Parameters:
entity
- The entity to add to the index.- Returns:
- A
CompletionStage
reflecting the completion state of the operation.
-
delete
Delete an entity from the index.Entities to reindex as a result of this operation will not be resolved.
Shorthand for
delete(providedId, null, entity)
; seedelete(Object, DocumentRoutesDescriptor, Object)
.- Parameters:
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.entity
- The entity to delete from the index.- Returns:
- A
CompletionStage
reflecting the completion state of the operation.
-
delete
CompletionStage<?> delete(Object providedId, DocumentRoutesDescriptor providedRoutes, Object entity) 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:
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.- Returns:
- A
CompletionStage
reflecting the completion state of the operation.
-
delete
CompletionStage<?> delete(Class<?> entityClass, Object providedId, DocumentRoutesDescriptor providedRoutes) 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:
entityClass
- The class of the entity to delete from the index.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
.- Returns:
- A
CompletionStage
reflecting the completion state of the operation.
-