Class SearchManagerImpl

    • Constructor Detail

      • SearchManagerImpl

        public SearchManagerImpl​(AdvancedCache<?,​?> cache)
    • Method Detail

      • getQuery

        public <E> CacheQuery<E> getQuery​(org.apache.lucene.search.Query luceneQuery,
                                          IndexedQueryMode indexedQueryMode,
                                          Class<?>... classes)
        Description copied from interface: SearchManager
        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 SearchManager
        Parameters:
        luceneQuery - Query
        indexedQueryMode - The IndexedQueryMode used 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

        public <E> CacheQuery<E> getQuery​(org.hibernate.search.query.engine.spi.HSQuery hSearchQuery,
                                          IndexedQueryMode queryMode)
        Internal and experimental! Creates a CacheQuery, filtered according to the given HSQuery.
        Parameters:
        hSearchQuery - HSQuery
        Returns:
        the CacheQuery object which can be used to iterate through results
      • registerKeyTransformer

        public void registerKeyTransformer​(Class<?> keyClass,
                                           Class<? extends Transformer> transformerClass)
        Description copied from interface: SearchManagerImplementor
        Registers a Transformer for the supplied key class. When storing keys in cache that are neither simple (String, int, ...) nor annotated with @Transformable, Infinispan-Query will need to know what Transformer to use when transforming the keys to Strings. Clients must specify what Transformer to use for a particular key class by registering it through this method.

        WARNING: this method registers the transformer on the local node only (see https://issues.jboss.org/browse/ISPN-9513)

        Specified by:
        registerKeyTransformer in interface SearchManagerImplementor
        Parameters:
        keyClass - the key class for which the supplied transformerClass should be used
        transformerClass - the transformer class to use for the supplied key class
      • 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
      • buildQueryBuilderForClass

        public org.hibernate.search.query.dsl.EntityContext buildQueryBuilderForClass​(Class<?> entityType)
        Description copied from interface: SearchManager
        Provides the Hibernate Search DSL entrypoint to build full text queries.
        Specified by:
        buildQueryBuilderForClass in interface SearchManager
        Returns:
        EntityContext
      • 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