Infinispan Distribution 5.2.6.Final-redhat-2

org.infinispan.query
Interface SearchManager


public interface SearchManager

The SearchManager is the entry point to create full text queries on top of a cache.

Author:
Sanne Grinovero (C) 2011 Red Hat Inc., Marko Luksa

Method Summary
 org.hibernate.search.query.dsl.EntityContext buildQueryBuilderForClass(Class<?> entityType)
          Experimental.
 CacheQuery getClusteredQuery(org.apache.lucene.search.Query luceneQuery, Class<?>... classes)
          Experimental! Use it to try out the newly introduced distributed queries.
 MassIndexer getMassIndexer()
          The MassIndexer can be used to rebuild the Lucene indexes from the entries stored in Infinispan.
 CacheQuery getQuery(org.apache.lucene.search.Query luceneQuery, Class<?>... classes)
          This is a simple method that will just return a CacheQuery, filtered according to a set of classes passed in.
 org.hibernate.search.SearchFactory getSearchFactory()
          Experimental.
 void registerKeyTransformer(Class<?> keyClass, Class<? extends Transformer> transformerClass)
          Registers a Transformer for the supplied key class.
 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.
 

Method Detail

getQuery

CacheQuery getQuery(org.apache.lucene.search.Query luceneQuery,
                    Class<?>... classes)
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.

Parameters:
luceneQuery - - 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

buildQueryBuilderForClass

org.hibernate.search.query.dsl.EntityContext buildQueryBuilderForClass(Class<?> entityType)
Experimental. Provides Hibernate Search DSL to build full text queries

Returns:

getSearchFactory

org.hibernate.search.SearchFactory getSearchFactory()
Experimental. Access the SearchFactory


getClusteredQuery

CacheQuery getClusteredQuery(org.apache.lucene.search.Query luceneQuery,
                             Class<?>... classes)
Experimental! Use it to try out the newly introduced distributed queries.

Parameters:
luceneQuery -
classes -
Returns:

getMassIndexer

MassIndexer getMassIndexer()
The MassIndexer can be used to rebuild the Lucene indexes from the entries stored in Infinispan.

Returns:
the MassIndexer component

registerKeyTransformer

void registerKeyTransformer(Class<?> keyClass,
                            Class<? extends Transformer> transformerClass)
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.

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

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.

Parameters:
timeoutExceptionFactory - the timeout exception factory to use

Infinispan Distribution 5.2.6.Final-redhat-2

Copyright © 2013 JBoss, a division of Red Hat. All Rights Reserved.