public interface FullTextEntityManager extends EntityManager
Modifier and Type | Method and Description |
---|---|
FullTextQuery |
createFullTextQuery(org.apache.lucene.search.Query luceneQuery,
Class<?>... entities)
Create a fulltext query on top of a native Lucene query returning the matching objects
of type
entities and their respective subclasses. |
FullTextQuery |
createFullTextQuery(org.hibernate.search.query.engine.spi.QueryDescriptor descriptor,
Class<?>... entities)
Creates a fulltext query from the given query descriptor.
|
MassIndexer |
createIndexer(Class<?>... types)
Creates a MassIndexer to rebuild the indexes of some
or all indexed entity types.
|
void |
flushToIndexes()
Flush all index changes forcing Hibernate Search to apply all changes to the index not waiting for the batch limit.
|
SearchFactory |
getSearchFactory() |
<T> void |
index(T entity)
Force the (re)indexing of a given managed object.
|
<T> void |
purge(Class<T> entityType,
Serializable id)
Remove the entity with the type
entityType and the identifier id from the index. |
<T> void |
purgeAll(Class<T> entityType)
Remove all entities from of particular class and all its subclasses from the index.
|
clear, close, contains, createEntityGraph, createEntityGraph, createNamedQuery, createNamedQuery, createNamedStoredProcedureQuery, createNativeQuery, createNativeQuery, createNativeQuery, createQuery, createQuery, createQuery, createQuery, createQuery, createStoredProcedureQuery, createStoredProcedureQuery, createStoredProcedureQuery, detach, find, find, find, find, flush, getCriteriaBuilder, getDelegate, getEntityGraph, getEntityGraphs, getEntityManagerFactory, getFlushMode, getLockMode, getMetamodel, getProperties, getReference, getTransaction, isJoinedToTransaction, isOpen, joinTransaction, lock, lock, merge, persist, refresh, refresh, refresh, refresh, remove, setFlushMode, setProperty, unwrap
FullTextQuery createFullTextQuery(org.apache.lucene.search.Query luceneQuery, Class<?>... entities)
entities
and their respective subclasses.luceneQuery
- The native Lucene query to be rn against the Lucene index.entities
- List of classes for type filtering. The query result will only return entities of
the specified types and their respective subtype. If no class is specified no type filtering will take place.FullTextQuery
wrapping around the native Lucene wuery.IllegalArgumentException
- if entityType is null
or not a class or superclass annotated with @Indexed
.FullTextQuery createFullTextQuery(org.hibernate.search.query.engine.spi.QueryDescriptor descriptor, Class<?>... entities)
descriptor
- The query descriptorentities
- List of classes for type filtering. The query result will only return entities of
the specified types and their respective subtype. If no class is specified no type filtering will take place.FullTextQuery
using the given query descriptor.IllegalArgumentException
- if entityType is null
or not a class or superclass annotated with @Indexed
.<T> void index(T entity)
Any EntityIndexingInterceptor
registered on the entity will be ignored:
this method forces an index operation.
T
- the type of the entity to indexentity
- The entity to index - must not be null
.IllegalArgumentException
- if entity is null or not an @Indexed entitySearchFactory getSearchFactory()
SearchFactory
instance.<T> void purge(Class<T> entityType, Serializable id)
entityType
and the identifier id
from the index.
If id == null
all indexed entities of this type and its indexed subclasses are deleted. In this
case this method behaves like purgeAll(Class)
.
Any EntityIndexingInterceptor
registered on the entity will be ignored:
this method forces a purge operation.
T
- the type of the entity to purgeentityType
- The type of the entity to delete.id
- The id of the entity to delete.IllegalArgumentException
- if entityType is null
or not a class or superclass annotated with @Indexed
.<T> void purgeAll(Class<T> entityType)
Any EntityIndexingInterceptor
registered on the entity type will be ignored.
T
- the type of the entity to purgeentityType
- The class of the entities to remove.IllegalArgumentException
- if entityType is null
or not a class or superclass annotated with @Indexed
.void flushToIndexes()
MassIndexer createIndexer(Class<?>... types)
Any EntityIndexingInterceptor
registered on the entity types are applied: each instance will trigger
an EntityIndexingInterceptor.onAdd(Object)
event from where you can customize the indexing operation.
types
- optionally restrict the operation to selected typesCopyright © 2019 JBoss by Red Hat. All rights reserved.