public interface CacheQuery extends Iterable<Object>
SearchManagerImpl. This object can
have methods such as list, setFirstResult,setMaxResults, setFetchSize, getResultSize and setSort.
SearchManagerImpl#getQuery(org.apache.lucene.search.Query)| Modifier and Type | Method and Description |
|---|---|
CacheQuery |
disableFullTextFilter(String name)
Disable a given filter by its name.
|
org.hibernate.search.FullTextFilter |
enableFullTextFilter(String name)
Enable a given filter by its name.
|
org.apache.lucene.search.Explanation |
explain(int documentId)
Return the Lucene
Explanation
object describing the score computation for the matching object/document
in the current query |
CacheQuery |
filter(org.apache.lucene.search.Filter f)
Allows lucene to filter the results.
|
CacheQuery |
firstResult(int index)
Sets a result with a given index to the first result.
|
org.hibernate.search.query.engine.spi.FacetManager |
getFacetManager() |
int |
getResultSize()
Gets the integer number of results.
|
ResultIterator |
iterator()
Returns the results of a search as a
ResultIterator. |
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 numResults)
Sets the maximum number of results to the number passed in as a parameter.
|
CacheQuery |
projection(String... fields)
Defines the Lucene field names projected and returned in a query result
Each field is converted back to it's object representation, an Object[] being returned for each "row"
A projectable field must be stored in the Lucene index and use a
TwoWayFieldBridge
Unless notified in their JavaDoc, all built-in bridges are two-way. |
CacheQuery |
sort(org.apache.lucene.search.Sort s)
Allows lucene to sort the results.
|
CacheQuery |
timeout(long timeout,
TimeUnit timeUnit)
Set the timeout for this query.
|
List<Object> list()
ResultIterator iterator(FetchOptions fetchOptions)
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.fetchOptions - how to fetch results (see @link FetchOptions)ResultIterator iterator()
ResultIterator. This calls iterator(FetchOptions fetchOptions)
with default FetchOptions; this implies eager loading of all results.CacheQuery firstResult(int index)
index - of result to be set to the first.IllegalArgumentException - if the index given is less than zero.CacheQuery maxResults(int numResults)
numResults - that are to be set to the maxResults.org.hibernate.search.query.engine.spi.FacetManager getFacetManager()
int getResultSize()
org.apache.lucene.search.Explanation explain(int documentId)
Explanation
object describing the score computation for the matching object/document
in the current querydocumentId - Lucene Document id to be explain. This is NOT the object keyCacheQuery sort(org.apache.lucene.search.Sort s)
s - - lucene sort objectCacheQuery projection(String... fields)
TwoWayFieldBridge
Unless notified in their JavaDoc, all built-in bridges are two-way. All @DocumentId fields are projectable by design.
If the projected field is not a projectable field, null is returned in the object[]fields - the projected field namesthis to allow for method chainingorg.hibernate.search.FullTextFilter enableFullTextFilter(String name)
name - of filter.CacheQuery disableFullTextFilter(String name)
name - of filter.CacheQuery filter(org.apache.lucene.search.Filter f)
f - - lucene filterCacheQuery timeout(long timeout, TimeUnit timeUnit)
timeout - the timeout durationtimeUnit - the time unit of the timeout parameterCopyright © 2017 JBoss, a division of Red Hat. All Rights Reserved.