public interface FullTextQuery extends Query, org.hibernate.search.ProjectionConstants
Modifier and Type | Method and Description |
---|---|
void |
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 |
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)
Allows to use lucene filters.
|
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) |
executeUpdate, getLockOptions, getNamedParameters, getQueryString, getReturnAliases, getReturnTypes, isReadOnly, 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, uniqueResult
FullTextQuery setSort(org.apache.lucene.search.Sort sort)
sort
- The lucene sort object.FullTextQuery setFilter(org.apache.lucene.search.Filter filter)
filter
- The lucene filter.int getResultSize()
list().size()
because list() if the index is
not in sync with the database at the time of query.FullTextQuery setCriteriaQuery(Criteria criteria)
criteria
- Hibernate criteria query used to load resultsthis
for method chainingFullTextQuery setProjection(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
- 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.FullTextFilter enableFullTextFilter(String name)
name
- the name of the filter to enableFullTextFilter
object that allows filter parameter injectionSearchException
- 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 Query
firstResult
- a row number, numbered from 0FullTextQuery setMaxResults(int maxResults)
setMaxResults
in interface Query
maxResults
- the maximum number of rowsFullTextQuery setFetchSize(int i)
setFetchSize
in interface Query
i
- the fetch sizeFullTextQuery setResultTransformer(ResultTransformer transformer)
setResultTransformer
in interface Query
transformer
- The transformer to apply<T> T unwrap(Class<T> type)
type
- 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)
Copyright © 2018 JBoss by Red Hat. All rights reserved.