org.hibernate.search
public interface FullTextQuery extends Query, ProjectionConstants
DOCUMENT, DOCUMENT_ID, EXPLANATION, ID, OBJECT_CLASS, SCORE, SPATIAL_DISTANCE, THIS| Modifier and Type | Method and Description |
|---|---|
void |
disableFullTextFilter(String name)
Disable a given filter by its name.
|
FullTextFilter |
enableFullTextFilter(String name)
Enable a given filter by its name.
|
Explanation |
explain(int documentId)
Return the Lucene
Explanation
object describing the score computation for the matching object/document
in the current query |
FacetManager |
getFacetManager() |
int |
getResultSize() |
boolean |
hasPartialResults()
Experimental API, subject to change or removal
|
FullTextQuery |
initializeObjectsWith(ObjectLookupMethod lookupMethod,
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(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(Sort sort)
Allows to let lucene sort the results.
|
FullTextQuery |
setSpatialParameters(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, uniqueResultFullTextQuery setSort(Sort sort)
sort - The lucene sort object.FullTextQuery setFilter(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(Coordinates center, String fieldName)
center - the search centerfieldName - name of the spatial fieldthis for method chainingFullTextFilter 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.FacetManager getFacetManager()
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 QueryFullTextQuery setMaxResults(int maxResults)
setMaxResults in interface QueryFullTextQuery setFetchSize(int i)
setFetchSize in interface QueryFullTextQuery setResultTransformer(ResultTransformer transformer)
setResultTransformer in interface Query<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(ObjectLookupMethod lookupMethod, DatabaseRetrievalMethod retrievalMethod)
Copyright © 2006-2015 Red Hat, Inc. All Rights Reserved