Class SearchManagerImpl

    • Constructor Summary

      Constructors 
      Constructor Description
      SearchManagerImpl​(org.infinispan.AdvancedCache<?,​?> cache, QueryEngine<?> queryEngine)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      org.apache.lucene.analysis.Analyzer getAnalyzer​(Class<?> clazz)
      Retrieves the scoped analyzer for a given class type.
      org.apache.lucene.analysis.Analyzer getAnalyzer​(String name)
      Retrieve an analyzer instance by its definition name
      MassIndexer getMassIndexer()
      The MassIndexer can be used to rebuild the Lucene indexes from the entries stored in Infinispan.
      <E> CacheQuery<E> getQuery​(String queryString)
      Builds a CacheQuery from an Ickle query string, assuming the correct value for IndexedQueryMode to query all data in the cluster
      <E> CacheQuery<E> getQuery​(String queryString, org.infinispan.query.dsl.IndexedQueryMode indexedQueryMode)
      Builds a CacheQuery from an Ickle query string.
      <E> CacheQuery<E> getQuery​(org.apache.lucene.search.Query luceneQuery, org.infinispan.query.dsl.IndexedQueryMode indexedQueryMode, Class<?> entity)
      This is a simple method that will just return a CacheQuery, filtered according to a set of classes passed in.
      <E> CacheQuery<E> getQuery​(QueryDefinition queryDefinition, org.infinispan.query.dsl.IndexedQueryMode indexedQueryMode, org.hibernate.search.spi.IndexedTypeMap<org.hibernate.search.spi.CustomTypeMetadata> indexedTypeMap)
      Creates a cache query based on a QueryDefinition and a custom metadata.
      org.hibernate.search.stat.Statistics getStatistics()
      Get access to the Query specific statistics for this SearchManager instance
      void purge​(Class<?> entityType)
      Remove all entities of particular class from the index.
      void setTimeoutExceptionFactory​(org.hibernate.search.query.engine.spi.TimeoutExceptionFactory timeoutExceptionFactory)
      Define the timeout exception factory to customize the exception thrown when the query timeout is exceeded.
      <T> T unwrap​(Class<T> cls)
      This method gives access to internal Infinispan implementation details, and should not be normally needed.
    • Constructor Detail

      • SearchManagerImpl

        public SearchManagerImpl​(org.infinispan.AdvancedCache<?,​?> cache,
                                 QueryEngine<?> queryEngine)
    • Method Detail

      • getQuery

        public <E> CacheQuery<E> getQuery​(org.apache.lucene.search.Query luceneQuery,
                                          org.infinispan.query.dsl.IndexedQueryMode indexedQueryMode,
                                          Class<?> entity)
        Description copied from interface: SearchManagerImplementor
        This is a simple method that will just return a CacheQuery, 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.
        Specified by:
        getQuery in interface SearchManagerImplementor
        Parameters:
        luceneQuery - Query
        indexedQueryMode - The IndexedQueryMode used when executing the query.
        entity - The entity type to query against.
        Returns:
        the CacheQuery object which can be used to iterate through results.
      • getQuery

        public <E> CacheQuery<E> getQuery​(String queryString)
        Description copied from interface: SearchManager
        Builds a CacheQuery from an Ickle query string, assuming the correct value for IndexedQueryMode to query all data in the cluster
        Specified by:
        getQuery in interface SearchManager
        Parameters:
        queryString - the Ickle query
        Returns:
      • setTimeoutExceptionFactory

        public void setTimeoutExceptionFactory​(org.hibernate.search.query.engine.spi.TimeoutExceptionFactory timeoutExceptionFactory)
        Description copied from interface: SearchManagerImplementor
        Define the timeout exception factory to customize the exception thrown when the query timeout is exceeded.
        Specified by:
        setTimeoutExceptionFactory in interface SearchManagerImplementor
        Parameters:
        timeoutExceptionFactory - the timeout exception factory to use
      • getMassIndexer

        public MassIndexer getMassIndexer()
        Description copied from interface: SearchManager
        The MassIndexer can be used to rebuild the Lucene indexes from the entries stored in Infinispan.
        Specified by:
        getMassIndexer in interface SearchManager
        Returns:
        the MassIndexer component
      • getAnalyzer

        public org.apache.lucene.analysis.Analyzer getAnalyzer​(String name)
        Description copied from interface: SearchManager
        Retrieve an analyzer instance by its definition name
        Specified by:
        getAnalyzer in interface SearchManager
        Parameters:
        name - the name of the analyzer
        Returns:
        analyzer with the specified name
      • getStatistics

        public org.hibernate.search.stat.Statistics getStatistics()
        Description copied from interface: SearchManager
        Get access to the Query specific statistics for this SearchManager instance
        Specified by:
        getStatistics in interface SearchManager
        Returns:
        The statistics.
      • getAnalyzer

        public org.apache.lucene.analysis.Analyzer getAnalyzer​(Class<?> clazz)
        Description copied from interface: SearchManager
        Retrieves the scoped analyzer for a given class type.
        Specified by:
        getAnalyzer in interface SearchManager
        Parameters:
        clazz - The class for which to retrieve the analyzer.
        Returns:
        The scoped analyzer for the specified class.
      • purge

        public void purge​(Class<?> entityType)
        Description copied from interface: SearchManager
        Remove all entities of particular class from the index.
        Specified by:
        purge in interface SearchManager
        Parameters:
        entityType - The class of the entity to remove.
      • unwrap

        public <T> T unwrap​(Class<T> cls)
        Description copied from interface: SearchManager
        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.
        Specified by:
        unwrap in interface SearchManager
        Parameters:
        cls - the class of the desired internal component
        Returns:
        the 'unwrapped' internal component