Package org.infinispan.query
Interface SearchManager
-
public interface SearchManagerThe SearchManager is the entry point to create full text queries on top of an indexed cache.- Author:
- Sanne Grinovero <sanne@hibernate.org> (C) 2011 Red Hat Inc., Marko Luksa
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description org.hibernate.search.query.dsl.EntityContextbuildQueryBuilderForClass(Class<?> entityType)Deprecated.Support for Hibernate Search queries is deprecated.org.apache.lucene.analysis.AnalyzergetAnalyzer(Class<?> clazz)Retrieves the scoped analyzer for a given class type.org.apache.lucene.analysis.AnalyzergetAnalyzer(String name)Retrieve an analyzer instance by its definition nameMassIndexergetMassIndexer()The MassIndexer can be used to rebuild the Lucene indexes from the entries stored in Infinispan.<E> CacheQuery<E>getQuery(String queryString, IndexedQueryMode indexedQueryMode, Class<?>... classes)Builds aCacheQueryfrom an Ickle query string.<E> CacheQuery<E>getQuery(org.apache.lucene.search.Query luceneQuery, Class<?>... classes)Deprecated.Support for Lucene queries is deprecated.<E> CacheQuery<E>getQuery(org.apache.lucene.search.Query luceneQuery, IndexedQueryMode indexedQueryMode, Class<?>... classes)Deprecated.Support for Lucene queries is deprecated.org.hibernate.search.stat.StatisticsgetStatistics()Get access to the Query specific statistics for this SearchManager instancevoidpurge(Class<?> entityType)Remove all entities of particular class from the index.<T> Tunwrap(Class<T> cls)This method gives access to internal Infinispan implementation details, and should not be normally needed.
-
-
-
Method Detail
-
getQuery
@Deprecated <E> CacheQuery<E> getQuery(org.apache.lucene.search.Query luceneQuery, IndexedQueryMode indexedQueryMode, Class<?>... classes)
Deprecated.Support for Lucene queries is deprecated. UsegetQuery(String, IndexedQueryMode, Class[])instead.This is a simple method that will just return aCacheQuery, filtered according to a set of classes passed in. If no classes are passed in, it is assumed that no type filtering is performed and so all known types will be searched.- Parameters:
luceneQuery-QueryindexedQueryMode- TheIndexedQueryModeused when executing the query.classes- Optionally only return results of type that matches this list of acceptable types.- Returns:
- the CacheQuery object which can be used to iterate through results.
-
getQuery
<E> CacheQuery<E> getQuery(String queryString, IndexedQueryMode indexedQueryMode, Class<?>... classes)
Builds aCacheQueryfrom an Ickle query string.- Throws:
org.hibernate.search.exception.SearchException- if the queryString cannot be converted to an indexed query, due to lack of indexes to resolve it fully or if contains aggregations and grouping.- See Also:
getQuery(Query, IndexedQueryMode, Class...)
-
getQuery
@Deprecated <E> CacheQuery<E> getQuery(org.apache.lucene.search.Query luceneQuery, Class<?>... classes)
Deprecated.Support for Lucene queries is deprecated. UsegetQuery(String, IndexedQueryMode, Class[])instead.
-
buildQueryBuilderForClass
@Deprecated org.hibernate.search.query.dsl.EntityContext buildQueryBuilderForClass(Class<?> entityType)
Deprecated.Support for Hibernate Search queries is deprecated. UsegetQuery(String, IndexedQueryMode, Class[])instead.Provides the Hibernate Search DSL entrypoint to build full text queries.- Returns:
EntityContext
-
getMassIndexer
MassIndexer getMassIndexer()
The MassIndexer can be used to rebuild the Lucene indexes from the entries stored in Infinispan.- Returns:
- the MassIndexer component
-
getStatistics
org.hibernate.search.stat.Statistics getStatistics()
Get access to the Query specific statistics for this SearchManager instance- Returns:
- The statistics.
- Since:
- 7.0
-
getAnalyzer
org.apache.lucene.analysis.Analyzer getAnalyzer(String name)
Retrieve an analyzer instance by its definition name- Parameters:
name- the name of the analyzer- Returns:
- analyzer with the specified name
- Throws:
org.hibernate.search.exception.SearchException- if the definition name is unknown- Since:
- 7.0
-
getAnalyzer
org.apache.lucene.analysis.Analyzer getAnalyzer(Class<?> clazz)
Retrieves the scoped analyzer for a given class type.- Parameters:
clazz- The class for which to retrieve the analyzer.- Returns:
- The scoped analyzer for the specified class.
- Throws:
IllegalArgumentException- in caseclazz == nullor the specified class is not an indexed entity.- Since:
- 7.0
-
purge
void purge(Class<?> entityType)
Remove all entities of particular class from the index.- Parameters:
entityType- The class of the entity to remove.
-
unwrap
<T> T unwrap(Class<T> cls)
This method gives access to internal Infinispan implementation details, and should not be normally needed. The interface of the internal types does not constitute a public API and can (and probably will) change without notice.- Parameters:
cls- the class of the desired internal component- Returns:
- the 'unwrapped' internal component
- Throws:
IllegalArgumentException- if the class of the requested internal component is not recognized
-
-