public class ClusteredCacheQueryImpl extends CacheQueryImpl
cache, hSearchQuery, keyTransformationHandler
Constructor and Description |
---|
ClusteredCacheQueryImpl(org.apache.lucene.search.Query luceneQuery,
org.hibernate.search.spi.SearchFactoryIntegrator searchFactory,
ExecutorService asyncExecutor,
AdvancedCache<?,?> cache,
KeyTransformationHandler keyTransformationHandler,
Class<?>... classes) |
Modifier and Type | Method and Description |
---|---|
CacheQuery |
firstResult(int firstResult)
Sets the the result of the given integer value to the first result.
|
int |
getResultSize()
Gets the total number of results matching the query, ignoring pagination (firstResult, maxResult).
|
ResultIterator |
iterator(FetchOptions fetchOptions)
Returns the results of a search as a
ResultIterator . |
List<Object> |
list()
Returns the results of a search as a list.
|
CacheQuery |
maxResults(int maxResults)
Sets the maximum number of results to the number passed in as a parameter.
|
CacheQuery |
sort(org.apache.lucene.search.Sort sort)
Allows lucene to sort the results.
|
CacheQuery |
timeout(long timeout,
TimeUnit timeUnit)
Set the timeout for this query.
|
disableFullTextFilter, enableFullTextFilter, explain, filter, getFacetManager, iterator, projection
public ClusteredCacheQueryImpl(org.apache.lucene.search.Query luceneQuery, org.hibernate.search.spi.SearchFactoryIntegrator searchFactory, ExecutorService asyncExecutor, AdvancedCache<?,?> cache, KeyTransformationHandler keyTransformationHandler, Class<?>... classes)
public CacheQuery maxResults(int maxResults)
CacheQuery
maxResults
in interface CacheQuery
maxResults
in class CacheQueryImpl
maxResults
- that are to be set to the maxResults.public CacheQuery firstResult(int firstResult)
CacheQueryImpl
firstResult
in interface CacheQuery
firstResult
in class CacheQueryImpl
firstResult
- index to be set.public CacheQuery sort(org.apache.lucene.search.Sort sort)
CacheQuery
sort
in interface CacheQuery
sort
in class CacheQueryImpl
sort
- - lucene sort objectpublic int getResultSize()
CacheQuery
getResultSize
in interface CacheQuery
getResultSize
in class CacheQueryImpl
public ResultIterator iterator(FetchOptions fetchOptions) throws org.hibernate.search.SearchException
CacheQuery
ResultIterator
.
Warning: the return type is an extension of Iterator
which introduces a ResultIterator.close()
method. This close method needs to be invoked when the iteration is complete to avoid resource leakage.iterator
in interface CacheQuery
iterator
in class CacheQueryImpl
fetchOptions
- how to fetch results (see @link FetchOptions)org.hibernate.search.SearchException
public List<Object> list() throws org.hibernate.search.SearchException
CacheQuery
list
in interface CacheQuery
list
in class CacheQueryImpl
org.hibernate.search.SearchException
public CacheQuery timeout(long timeout, TimeUnit timeUnit)
CacheQuery
timeout
in interface CacheQuery
timeout
in class CacheQueryImpl
timeout
- the timeout durationtimeUnit
- the time unit of the timeout parameterCopyright © 2014 JBoss, a division of Red Hat. All Rights Reserved.