public interface FullTextQuery extends Query, org.hibernate.search.engine.ProjectionConstants
| Modifier and Type | Method and Description |
|---|---|
void |
disableFullTextFilter(String name)
Disable a given filter by its name.
|
org.hibernate.search.filter.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 |
org.hibernate.search.query.engine.spi.FacetManager |
getFacetManager() |
int |
getResultSize() |
boolean |
hasPartialResults()
Experimental API, subject to change or removal
|
FullTextQuery |
initializeObjectsWith(org.hibernate.search.query.ObjectLookupMethod lookupMethod,
org.hibernate.search.query.DatabaseRetrievalMethod retrievalMethod)
Refine the strategies used to load entities.
|
FullTextQuery |
limitExecutionTimeTo(long timeout,
TimeUnit timeUnit)
*Experimental* API, subject to change or removal
Limit the time used by Hibernate Search to execute the query.
|
FullTextQuery |
setCriteriaQuery(Criteria criteria)
Defines the Database Query used to load the Lucene results.
|
FullTextQuery |
setFetchSize(int i)
Defines scrollable result fetch size as well as the JDBC fetch size
|
FullTextQuery |
setFilter(org.apache.lucene.search.Filter filter)
Deprecated.
|
FullTextQuery |
setFirstResult(int firstResult)
|
FullTextQuery |
setMaxResults(int maxResults)
|
FullTextQuery |
setProjection(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"
(similar to an HQL or a Criteria API projection).
|
FullTextQuery |
setResultTransformer(ResultTransformer transformer)
defines a result transformer used during projection, the Aliases provided are the projection aliases.
|
FullTextQuery |
setSort(org.apache.lucene.search.Sort sort)
Allows to let lucene sort the results.
|
FullTextQuery |
setSpatialParameters(org.hibernate.search.spatial.Coordinates center,
String fieldName)
Defines the center of the spatial search for this query to project distance in results
|
FullTextQuery |
setSpatialParameters(double latitude,
double longitude,
String fieldName)
Defines the center of the spatial search for this query to project distance in results
|
FullTextQuery |
setTimeout(long timeout,
TimeUnit timeUnit)
Define a timeout period for a given unit of time.
|
<T> T |
unwrap(Class<T> type) |
addQueryHint, executeUpdate, getComment, getFirstResult, getLockOptions, getMaxResults, getNamedParameters, getQueryString, getReturnAliases, iterate, list, scroll, scroll, setBigDecimal, setBigDecimal, setBigInteger, setBigInteger, setBinary, setBinary, setBoolean, setBoolean, setByte, setByte, setCacheable, setCacheMode, setCacheRegion, setCalendar, setCalendar, setCalendarDate, setCalendarDate, setCharacter, setCharacter, setComment, setDate, setDate, setDouble, setDouble, setEntity, setEntity, setFloat, setFloat, setFlushMode, setInteger, setInteger, setLocale, setLocale, setLockMode, setLockOptions, setLong, setLong, setParameter, setParameter, setParameter, setParameter, setParameterList, setParameterList, setParameterList, setParameterList, setParameters, setProperties, setProperties, setReadOnly, setSerializable, setSerializable, setShort, setShort, setString, setString, setText, setText, setTime, setTime, setTimeout, setTimestamp, setTimestamp, uniqueResultgetCacheMode, getCacheRegion, getFetchSize, getFlushMode, getReturnTypes, getTimeout, isCacheable, isReadOnlyFullTextQuery setSort(org.apache.lucene.search.Sort sort)
sort - The lucene sort object.@Deprecated FullTextQuery setFilter(org.apache.lucene.search.Filter filter)
filter - The Lucene filter.Filterint getResultSize()
Caution:
The number of results might be slightly different from
list().size() because list() if the index is
not in sync with the database at the time of query.
FullTextQuery setCriteriaQuery(Criteria criteria)
criteria.setProjection()) allowed, the root entity must be the only returned typecriteria - Hibernate criteria query used to load resultsthis for method chainingFullTextQuery setProjection(String... fields)
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. All @DocumentId fields are projectable by design.
If the projected field is not a projectable field, null is returned in the object[]
fields - list of field names to project onthis for method chainingFullTextQuery setSpatialParameters(double latitude, double longitude, String fieldName)
latitude - latitude of the search centerlongitude - longitude of the search centerfieldName - name of the spatial fieldthis for method chainingFullTextQuery setSpatialParameters(org.hibernate.search.spatial.Coordinates center, String fieldName)
center - the search centerfieldName - name of the spatial fieldthis for method chainingorg.hibernate.search.filter.FullTextFilter enableFullTextFilter(String name)
name - the name of the filter to enableFullTextFilter object that allows filter parameter injectionorg.hibernate.search.exception.SearchException - in case the filter with the specified name is not definedvoid disableFullTextFilter(String name)
name - the name of the filter to disable.org.hibernate.search.query.engine.spi.FacetManager getFacetManager()
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 idExplanation instanceFullTextQuery setFirstResult(int firstResult)
setFirstResult in interface QueryfirstResult - a row number, numbered from 0this, for method chainingQuery.getFirstResult()FullTextQuery setMaxResults(int maxResults)
setMaxResults in interface QuerymaxResults - the maximum number of rowsthis, for method chainingQuery.getMaxResults()FullTextQuery setFetchSize(int i)
setFetchSize in interface BasicQueryContractsetFetchSize in interface Queryi - the fetch size hintthis, for method chainingBasicQueryContract.getFetchSize()FullTextQuery setResultTransformer(ResultTransformer transformer)
setResultTransformer in interface Querytransformer - The transformer to apply<T> T unwrap(Class<T> type)
T - the type of the unwrapped objecttype - the type to unwrapIllegalArgumentException is thrown. Supported types are:
FullTextQuery setTimeout(long timeout, TimeUnit timeUnit)
QueryTimeoutException is raised.timeout - time out periodtimeUnit - time out unitthis to allow method chainingFullTextQuery limitExecutionTimeTo(long timeout, TimeUnit timeUnit)
hasPartialResults() returns true.timeout - time out periodtimeUnit - time out unitthis to allow method chainingboolean hasPartialResults()
limitExecutionTimeTo(long, java.util.concurrent.TimeUnit) }, returns true
if partial results are returned (ie if the time limit has been reached
and the result fetching process has been terminated.FullTextQuery initializeObjectsWith(org.hibernate.search.query.ObjectLookupMethod lookupMethod, org.hibernate.search.query.DatabaseRetrievalMethod retrievalMethod)
lookupMethod - the lookuip strategyretrievalMethod - the retrieval strategythis to allow method chainingCopyright © 2017 JBoss by Red Hat. All rights reserved.