public interface EntityIndexingInterceptor<T>
The interceptor is applied to a MassIndexer operation, but is ignored when using
the explicit indexing control API such org.hibernate.search.FullTextSession.index(T)
or purge
and purgeAll
.
Implementations must be thread-safe and should have a no-arg constructor.
Typical use cases include the so called soft delete.
IndexingOverride
might be updatedModifier and Type | Method and Description |
---|---|
IndexingOverride |
onAdd(T entity)
Triggered when an entity instance T should be added to the index, either by an event listener or by the
MassIndexer.
|
IndexingOverride |
onCollectionUpdate(T entity)
A CollectionUpdate event is fired on collections included in an indexed entity, for example when using
IndexedEmbedded This event is triggered on each indexed domain instance T contained in such a collection;
this is generally similar to a onUpdate(Object) event. |
IndexingOverride |
onDelete(T entity)
Triggered when an entity instance T should be deleted from the index.
|
IndexingOverride |
onUpdate(T entity)
Triggered when an entity instance T should be updated in the index.
|
IndexingOverride onAdd(T entity)
entity
- The entity instanceIndexingOverride.APPLY_DEFAULT
to have the instance be added to the index as normal; return a
different value to override the behaviour.IndexingOverride onUpdate(T entity)
entity
- The entity instanceIndexingOverride.APPLY_DEFAULT
to have the instance removed and re-added to the index as
normal; return a different value to override the behaviour.IndexingOverride onDelete(T entity)
entity
- The entity instanceIndexingOverride.APPLY_DEFAULT
to have the instance removed from the index as normal;
return a different value to override the behaviour.IndexingOverride onCollectionUpdate(T entity)
IndexedEmbedded
This event is triggered on each indexed domain instance T contained in such a collection;
this is generally similar to a onUpdate(Object)
event.entity
- The entity instanceIndexingOverride.APPLY_DEFAULT
to have the instance removed and re-added to the index as
normal; return a different value to override the behaviour.Copyright © 2006-2017 Red Hat, Inc. All Rights Reserved