public interface SearchIndexingPlan
This class is stateful: it queues operations internally to apply them when the session is closed.
This contract is not thread-safe.
| Modifier and Type | Method and Description |
|---|---|
void |
add(Object entity)
Add an entity to the index, assuming that the entity is absent from the index.
|
void |
add(Object providedId,
Object entity)
Add an entity to the index, assuming that the entity is absent from the index.
|
void |
addOrUpdate(Object entity)
Update an entity in the index, or add it if it's absent from the index.
|
void |
addOrUpdate(Object providedId,
Object entity)
Update an entity in the index, or add it if it's absent from the index.
|
void |
addOrUpdate(Object providedId,
Object entity,
String... dirtyPaths)
Update an entity in the index, or add it if it's absent from the index,
but try to avoid reindexing if the given dirty paths
are known not to impact the indexed form of that entity.
|
void |
addOrUpdate(Object entity,
String... dirtyPaths)
Update an entity in the index, or add it if it's absent from the index,
but try to avoid reindexing if the given dirty paths
are known not to impact the indexed form of that entity.
|
void |
delete(Object entity)
Delete an entity from the index.
|
void |
delete(Object providedId,
Object entity)
Delete an entity from the index.
|
void add(Object entity)
Shorthand for add(null, entity); see add(Object, Object).
entity - The entity to add to the index.void add(Object providedId, Object entity)
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.
When in doubt, you should rather use addOrUpdate(Object, Object) or addOrUpdate(Object).
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.
If null, Hibernate Search will attempt to extract the ID from the entity.entity - The entity to add to the index.void addOrUpdate(Object entity)
Shorthand for update(null, entity); see addOrUpdate(Object, Object).
entity - The entity to update in the index.void addOrUpdate(Object providedId, Object entity)
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.
If null, Hibernate Search will attempt to extract the ID from the entity.entity - The entity to update in the index.void addOrUpdate(Object entity, String... dirtyPaths)
Assumes that the entity may already be present in the index.
Shorthand for update(null, entity, dirtyPaths); see addOrUpdate(Object, Object).
entity - The entity to update in the index.dirtyPaths - The paths to consider dirty, formatted using the dot-notation
("directEntityProperty.nestedPropery").void addOrUpdate(Object providedId, Object entity, String... dirtyPaths)
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.
If null, Hibernate Search will attempt to extract the ID from the entity.entity - The entity to update in the index.dirtyPaths - The paths to consider dirty, formatted using the dot-notation
("directEntityProperty.nestedPropery").void delete(Object entity)
Shorthand for delete(null, entity); see delete(Object, Object).
entity - The entity to delete from the index.void delete(Object providedId, Object entity)
No effect on the index if the entity is not 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.
If null, Hibernate Search will attempt to extract the ID from the entity.entity - The entity to delete from the index.Copyright © 2006-2019 Red Hat, Inc. and others. Licensed under the GNU Lesser General Public License (LGPL), version 2.1 or later.