|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface FullTextSession
Extends the Hibernate Session
with fulltext search and indexing capabilities.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface org.hibernate.Session |
---|
Session.LockRequest |
Method Summary | ||
---|---|---|
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. |
|
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()
|
|
|
index(T entity)
Force the (re)indexing of a given managed object. |
|
|
purge(Class<T> entityType,
Serializable id)
Remove the entity with the type entityType and the identifier id from the index. |
|
|
purgeAll(Class<T> entityType)
Remove all entities from of particular class and all its subclasses from the index. |
|
FullTextSharedSessionBuilder |
sessionWithOptions()
|
Methods inherited from interface org.hibernate.Session |
---|
buildLockRequest, byId, byId, byNaturalId, byNaturalId, bySimpleNaturalId, bySimpleNaturalId, cancelQuery, clear, close, contains, createFilter, delete, delete, disableFetchProfile, disableFilter, disconnect, doReturningWork, doWork, enableFetchProfile, enableFilter, evict, flush, get, get, get, get, get, get, getCacheMode, getCurrentLockMode, getEnabledFilter, getEntityName, getFlushMode, getIdentifier, getLobHelper, getSessionFactory, getStatistics, getTypeHelper, isConnected, isDefaultReadOnly, isDirty, isFetchProfileEnabled, isOpen, isReadOnly, load, load, load, load, load, load, load, lock, lock, merge, merge, persist, persist, reconnect, refresh, refresh, refresh, refresh, refresh, replicate, replicate, save, save, saveOrUpdate, saveOrUpdate, setCacheMode, setDefaultReadOnly, setFlushMode, setReadOnly, update, update |
Methods inherited from interface org.hibernate.SharedSessionContract |
---|
beginTransaction, createCriteria, createCriteria, createCriteria, createCriteria, createQuery, createSQLQuery, getNamedQuery, getTenantIdentifier, getTransaction |
Method Detail |
---|
FullTextQuery createFullTextQuery(org.apache.lucene.search.Query luceneQuery, Class<?>... entities)
entities
and their respective subclasses.
luceneQuery
- The native Lucene query to be run 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 query.
IllegalArgumentException
- if entityType is null
or not a class or superclass annotated with @Indexed
.<T> void index(T entity)
EntityIndexingInterceptor
registered on the entity will be ignored:
this method forces an index operation.
entity
- 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.
entityType
- 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)
EntityIndexingInterceptor
registered on the entity type will be ignored.
entityType
- 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)
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 types
FullTextSharedSessionBuilder sessionWithOptions()
sessionWithOptions
in interface Session
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |