Class LuceneFullTextManager
java.lang.Object
org.hibernate.search.sandbox.standalone.LuceneFullTextManager
- All Implemented Interfaces:
FullTextManager
Implements a standalone full text service.
Data is stored in Lucene
-
Method Summary
Modifier and TypeMethodDescriptioncreateFullTextQuery(Query luceneQuery, Class<?>... entities) Create a fulltext query on top of a native Lucene query returning the matching objects of typeentitiesand their respective subclasses.voidFlush all index changes forcing Hibernate Search to apply all changes to the index not waiting for the batch limit.<T> Tget(Class<T> entityType, Serializable id) Returns the entity instance of a given type and id value<T> voidindex(T entity) (Re-)index an entity.<T> voidpurge(Class<T> entityType, Serializable id) Remove the entity with the typeentityTypeand the identifieridfrom the index.<T> voidRemove all entities from of particular class and all its subclasses from the index.
-
Method Details
-
get
Description copied from interface:FullTextManagerReturns the entity instance of a given type and id value- Specified by:
getin interfaceFullTextManager
-
createFullTextQuery
Description copied from interface:FullTextManagerCreate a fulltext query on top of a native Lucene query returning the matching objects of typeentitiesand their respective subclasses.- Specified by:
createFullTextQueryin interfaceFullTextManager- Parameters:
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.- Returns:
- A
FullTextQuerywrapping around the native Lucene query.
-
index
public <T> void index(T entity) (Re-)index an entity. The entity must be associated with the session and non indexable entities are ignored.- Specified by:
indexin interfaceFullTextManager- Parameters:
entity- The entity to index - must not benull.- Throws:
IllegalArgumentException- if entity is null or not an @Indexed entity
-
getSearchFactory
- Specified by:
getSearchFactoryin interfaceFullTextManager- Returns:
- the
SearchFactoryinstance.
-
purge
Description copied from interface:FullTextManagerRemove the entity with the typeentityTypeand the identifieridfrom the index. Ifid == nullall indexed entities of this type and its indexed subclasses are deleted. In this case this method behaves likeFullTextManager.purgeAll(Class).- Specified by:
purgein interfaceFullTextManager- Parameters:
entityType- The type of the entity to delete.id- The id of the entity to delete.
-
purgeAll
Description copied from interface:FullTextManagerRemove all entities from of particular class and all its subclasses from the index.- Specified by:
purgeAllin interfaceFullTextManager- Parameters:
entityType- The class of the entities to remove.
-
flushToIndexes
public void flushToIndexes()Description copied from interface:FullTextManagerFlush all index changes forcing Hibernate Search to apply all changes to the index not waiting for the batch limit.- Specified by:
flushToIndexesin interfaceFullTextManager
-