|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.hibernate.internal.AbstractQueryImpl
org.hibernate.search.query.hibernate.impl.FullTextQueryImpl
public class FullTextQueryImpl
Implementation of FullTextQuery.
| Field Summary |
|---|
| Fields inherited from class org.hibernate.internal.AbstractQueryImpl |
|---|
parameterMetadata, session |
| Fields inherited from interface org.hibernate.search.ProjectionConstants |
|---|
DOCUMENT, DOCUMENT_ID, EXPLANATION, ID, OBJECT_CLASS, SCORE, SPATIAL_DISTANCE, THIS |
| Constructor Summary | |
|---|---|
FullTextQueryImpl(org.apache.lucene.search.Query query,
Class<?>[] classes,
org.hibernate.engine.spi.SessionImplementor session,
org.hibernate.engine.query.spi.ParameterMetadata parameterMetadata)
Constructs a FullTextQueryImpl instance. |
|
| Method Summary | ||
|---|---|---|
void |
disableFullTextFilter(String name)
Disable a given filter by its name. |
|
FullTextFilter |
enableFullTextFilter(String name)
Enable a given filter by its name. |
|
int |
executeUpdate()
|
|
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 |
|
FacetManager |
getFacetManager()
|
|
protected Map |
getLockModes()
|
|
org.hibernate.LockOptions |
getLockOptions()
|
|
int |
getResultSize()
|
|
boolean |
hasPartialResults()
Experimental API, subject to change or removal |
|
FullTextQuery |
initializeObjectsWith(ObjectLookupMethod lookupMethod,
DatabaseRetrievalMethod retrievalMethod)
Refine the strategies used to load entities. |
|
Iterator |
iterate()
Return an iterator on the results. |
|
FullTextQuery |
limitExecutionTimeTo(long timeout,
TimeUnit timeUnit)
*Experimental* API, subject to change or removal Limit the time used by Hibernate Search to execute the query. |
|
List |
list()
|
|
org.hibernate.ScrollableResults |
scroll()
|
|
org.hibernate.ScrollableResults |
scroll(org.hibernate.ScrollMode scrollMode)
|
|
FullTextQuery |
setCriteriaQuery(org.hibernate.Criteria criteria)
Defines the Database Query used to load the Lucene results. |
|
FullTextQuery |
setFetchSize(int fetchSize)
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)
Query.setFirstResult(int) |
|
org.hibernate.Query |
setLockMode(String alias,
org.hibernate.LockMode lockMode)
|
|
org.hibernate.Query |
setLockOptions(org.hibernate.LockOptions lockOptions)
|
|
FullTextQuery |
setMaxResults(int maxResults)
Query.setMaxResults(int) |
|
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(org.hibernate.transform.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(double latitude,
double longitude,
String fieldName)
Defines the center of the spatial search for this query to project distance in results |
|
FullTextQuery |
setSpatialParameters(Point center,
String fieldName)
Defines the center of the spatial search for this query to project distance in results |
|
FullTextQuery |
setTimeout(int timeout)
|
|
FullTextQuery |
setTimeout(long timeout,
TimeUnit timeUnit)
Define a timeout period for a given unit of time. |
|
|
unwrap(Class<T> type)
|
|
| Methods inherited from class org.hibernate.internal.AbstractQueryImpl |
|---|
after, before, determineType, determineType, determineType, determineType, determineType, expandParameterLists, getCacheMode, getNamedParameterLists, getNamedParameters, getNamedParams, getParameterMetadata, getQueryParameters, getQueryString, getReturnAliases, getReturnTypes, getRowSelection, getSelection, getTypes, getValues, hasNamedParameters, isReadOnly, setBigDecimal, setBigDecimal, setBigInteger, setBigInteger, setBinary, setBinary, setBoolean, setBoolean, setByte, setByte, setCacheable, setCacheMode, setCacheRegion, setCalendar, setCalendar, setCalendarDate, setCalendarDate, setCharacter, setCharacter, setCollectionKey, setComment, setDate, setDate, setDouble, setDouble, setEntity, setEntity, setFloat, setFloat, setFlushMode, setInteger, setInteger, setLocale, setLocale, setLong, setLong, setOptionalEntityName, setOptionalId, setOptionalObject, setParameter, setParameter, setParameter, setParameter, setParameterList, setParameterList, setParameterList, setParameterList, setParameters, setProperties, setProperties, setReadOnly, setSerializable, setSerializable, setShort, setShort, setString, setString, setText, setText, setTime, setTime, setTimestamp, setTimestamp, toString, typeArray, uniqueResult, valueArray, verifyParameters, verifyParameters |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.hibernate.Query |
|---|
getNamedParameters, getQueryString, getReturnAliases, getReturnTypes, isReadOnly, 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, setLong, setLong, setParameter, setParameter, setParameter, setParameter, setParameterList, setParameterList, setParameterList, setParameterList, setParameters, setProperties, setProperties, setReadOnly, setSerializable, setSerializable, setShort, setShort, setString, setString, setText, setText, setTime, setTime, setTimestamp, setTimestamp, uniqueResult |
| Constructor Detail |
|---|
public FullTextQueryImpl(org.apache.lucene.search.Query query,
Class<?>[] classes,
org.hibernate.engine.spi.SessionImplementor session,
org.hibernate.engine.query.spi.ParameterMetadata parameterMetadata)
FullTextQueryImpl instance.
query - The Lucene query.classes - Array of classes (must be immutable) used to filter the results to the given class types.session - Access to the Hibernate session.parameterMetadata - Additional query metadata.| Method Detail |
|---|
public FullTextQuery setSort(org.apache.lucene.search.Sort sort)
setSort in interface FullTextQuerysort - The lucene sort object.
public FullTextQuery setFilter(org.apache.lucene.search.Filter filter)
setFilter in interface FullTextQueryfilter - The lucene filter.
public Iterator iterate()
throws org.hibernate.HibernateException
iterate in interface org.hibernate.Queryorg.hibernate.HibernateException
public org.hibernate.ScrollableResults scroll()
throws org.hibernate.HibernateException
scroll in interface org.hibernate.Queryorg.hibernate.HibernateException
public org.hibernate.ScrollableResults scroll(org.hibernate.ScrollMode scrollMode)
throws org.hibernate.HibernateException
scroll in interface org.hibernate.Queryorg.hibernate.HibernateException
public List list()
throws org.hibernate.HibernateException
list in interface org.hibernate.Queryorg.hibernate.HibernateExceptionpublic org.apache.lucene.search.Explanation explain(int documentId)
FullTextQueryExplanation
object describing the score computation for the matching object/document
in the current query
explain in interface FullTextQuerydocumentId - Lucene Document id to be explain. This is NOT the object id
Explanation instancepublic int getResultSize()
getResultSize in interface FullTextQuerylist().size() because list() if the index is
not in sync with the database at the time of query.public FullTextQuery setCriteriaQuery(org.hibernate.Criteria criteria)
FullTextQuery
setCriteriaQuery in interface FullTextQuerycriteria - Hibernate criteria query used to load results
this for method chainingpublic FullTextQuery setProjection(String... fields)
FullTextQueryTwoWayFieldBridge
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[]
setProjection in interface FullTextQueryfields - list of field names to project on
this for method chaining
public FullTextQuery setSpatialParameters(Point center,
String fieldName)
FullTextQuery
setSpatialParameters in interface FullTextQuerycenter - the search centerfieldName - name of the spatial field
this for method chaining
public FullTextQuery setSpatialParameters(double latitude,
double longitude,
String fieldName)
FullTextQuery
setSpatialParameters in interface FullTextQuerylatitude - latitude of the search centerlongitude - longitude of the search centerfieldName - name of the spatial field
this for method chainingpublic FullTextQuery setFirstResult(int firstResult)
FullTextQueryQuery.setFirstResult(int)
setFirstResult in interface org.hibernate.QuerysetFirstResult in interface FullTextQuerysetFirstResult in class org.hibernate.internal.AbstractQueryImplpublic FullTextQuery setMaxResults(int maxResults)
FullTextQueryQuery.setMaxResults(int)
setMaxResults in interface org.hibernate.QuerysetMaxResults in interface FullTextQuerysetMaxResults in class org.hibernate.internal.AbstractQueryImplpublic FullTextQuery setFetchSize(int fetchSize)
FullTextQuery
setFetchSize in interface org.hibernate.QuerysetFetchSize in interface FullTextQuerysetFetchSize in class org.hibernate.internal.AbstractQueryImplpublic org.hibernate.Query setLockOptions(org.hibernate.LockOptions lockOptions)
setLockOptions in interface org.hibernate.Querypublic FullTextQuery setResultTransformer(org.hibernate.transform.ResultTransformer transformer)
FullTextQuery
setResultTransformer in interface org.hibernate.QuerysetResultTransformer in interface FullTextQuerysetResultTransformer in class org.hibernate.internal.AbstractQueryImplpublic <T> T unwrap(Class<T> type)
unwrap in interface FullTextQuerytype - the type to unwrap
IllegalArgumentException is thrown. Supported types are:
public org.hibernate.LockOptions getLockOptions()
getLockOptions in class org.hibernate.internal.AbstractQueryImpl
public int executeUpdate()
throws org.hibernate.HibernateException
executeUpdate in interface org.hibernate.Queryorg.hibernate.HibernateException
public org.hibernate.Query setLockMode(String alias,
org.hibernate.LockMode lockMode)
setLockMode in interface org.hibernate.Queryprotected Map getLockModes()
public FullTextFilter enableFullTextFilter(String name)
FullTextQuery
enableFullTextFilter in interface FullTextQueryname - the name of the filter to enable
FullTextFilter object that allows filter parameter injectionpublic void disableFullTextFilter(String name)
FullTextQuery
disableFullTextFilter in interface FullTextQueryname - the name of the filter to disable.public FacetManager getFacetManager()
getFacetManager in interface FullTextQuerypublic FullTextQuery setTimeout(int timeout)
setTimeout in interface org.hibernate.QuerysetTimeout in class org.hibernate.internal.AbstractQueryImpl
public FullTextQuery setTimeout(long timeout,
TimeUnit timeUnit)
FullTextQueryQueryTimeoutException is raised.
setTimeout in interface FullTextQuerytimeout - time out periodtimeUnit - time out unit
this to allow method chaining
public FullTextQuery limitExecutionTimeTo(long timeout,
TimeUnit timeUnit)
FullTextQueryFullTextQuery.hasPartialResults() returns true.
limitExecutionTimeTo in interface FullTextQuerytimeout - time out periodtimeUnit - time out unit
this to allow method chainingpublic boolean hasPartialResults()
FullTextQuery
hasPartialResults in interface FullTextQueryFullTextQuery.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.
public FullTextQuery initializeObjectsWith(ObjectLookupMethod lookupMethod,
DatabaseRetrievalMethod retrievalMethod)
FullTextQuery
initializeObjectsWith in interface FullTextQuery
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||