public interface FullTextQuery extends Query, org.hibernate.search.engine.ProjectionConstants
Query).| 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()
Returns the number of hits for this search
Caution:
The number of results might be slightly different from
getResultList().size() because getResultList()
may be not in sync with the database at the time of query. |
boolean |
hasPartialResults() |
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)
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 |
setFilter(org.apache.lucene.search.Filter filter)
Deprecated.
|
FullTextQuery |
setFirstResult(int var1)
Set the position of the first result to retrieve.
|
FullTextQuery |
setFlushMode(FlushModeType flushMode)
Set the flush mode type to be used for the query execution.
|
FullTextQuery |
setHint(String hintName,
Object value)
Set a query property or hint.
|
FullTextQuery |
setMaxResults(int maxResult)
Set the maximum number of results to retrieve.
|
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
|
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.
|
executeUpdate, getFirstResult, getFlushMode, getHints, getLockMode, getMaxResults, getParameter, getParameter, getParameter, getParameter, getParameters, getParameterValue, getParameterValue, getParameterValue, getResultList, getResultStream, getSingleResult, isBound, setLockMode, setParameter, setParameter, setParameter, setParameter, setParameter, setParameter, setParameter, setParameter, setParameter, unwrapFullTextQuery 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()
getResultList().size() because getResultList()
may be not in sync with the database at the time of query.FullTextQuery setCriteriaQuery(Criteria criteria)
criteria - a query defined using Criteriathis 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 - the fields to use for projectionthis 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 filterFullTextFilter object that allows filter parameter injectionvoid disableFullTextFilter(String name)
name - the filter naneorg.hibernate.search.query.engine.spi.FacetManager getFacetManager()
FullTextQuery setResultTransformer(ResultTransformer transformer)
transformer - the ResultTransformer to use during projectionthis for method chainingorg.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 idExplanationFullTextQuery limitExecutionTimeTo(long timeout, TimeUnit timeUnit)
hasPartialResults() returns true.timeout - time out periodtimeUnit - time out unitthis for 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 - lookup methodretrievalMethod - how to initilize an objectthis for method chainingFullTextQuery setMaxResults(int maxResult)
QuerysetMaxResults in interface QuerymaxResult - maximum number of results to retrieveFullTextQuery setFirstResult(int var1)
QuerysetFirstResult in interface Queryvar1 - position of the first result,
numbered from 0FullTextQuery setHint(String hintName, Object value)
QueryFullTextQuery setFlushMode(FlushModeType flushMode)
QuerysetFlushMode in interface QueryflushMode - flush modeFullTextQuery setTimeout(long timeout, TimeUnit timeUnit)
QueryTimeoutException is raised.timeout - time out periodtimeUnit - time out unitthis to allow method chainingCopyright © 2019 JBoss by Red Hat. All rights reserved.