|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.hibernate.impl.AbstractQueryImpl
org.hibernate.search.query.FullTextQueryImpl
public class FullTextQueryImpl
Implementation of FullTextQuery.
| Field Summary |
|---|
| Fields inherited from class org.hibernate.impl.AbstractQueryImpl |
|---|
parameterMetadata, session |
| Fields inherited from interface org.hibernate.search.ProjectionConstants |
|---|
BOOST, DOCUMENT, DOCUMENT_ID, EXPLANATION, ID, OBJECT_CLASS, SCORE, THIS |
| Constructor Summary | |
|---|---|
FullTextQueryImpl(org.apache.lucene.search.Query query,
java.lang.Class<?>[] classes,
org.hibernate.engine.SessionImplementor session,
org.hibernate.engine.query.ParameterMetadata parameterMetadata)
Constructs a FullTextQueryImpl instance. |
|
| Method Summary | ||
|---|---|---|
void |
disableFullTextFilter(java.lang.String name)
Disable a given filter by its name |
|
FullTextFilter |
enableFullTextFilter(java.lang.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 |
|
protected java.util.Map |
getLockModes()
|
|
org.hibernate.LockOptions |
getLockOptions()
|
|
int |
getResultSize()
Returns the number of hits for this search 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. |
|
java.util.Iterator |
iterate()
Return an iterator on the results. |
|
java.util.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)
{link:Query#setFirstResult} |
|
org.hibernate.Query |
setLockMode(java.lang.String alias,
org.hibernate.LockMode lockMode)
|
|
org.hibernate.Query |
setLockOptions(org.hibernate.LockOptions lockOptions)
|
|
FullTextQuery |
setMaxResults(int maxResults)
{link:Query#setMaxResults} |
|
FullTextQuery |
setProjection(java.lang.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. |
|
|
unwrap(java.lang.Class<T> type)
return the underlying type if possible or IllegalArgumentException otherwise Supported types are: - org.apache.lucene.search.Query the underlying lucene query |
|
| Methods inherited from class org.hibernate.impl.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, setTimeout, 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, setTimeout, setTimestamp, setTimestamp, uniqueResult |
| Constructor Detail |
|---|
public FullTextQueryImpl(org.apache.lucene.search.Query query,
java.lang.Class<?>[] classes,
org.hibernate.engine.SessionImplementor session,
org.hibernate.engine.query.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 java.util.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 java.util.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
public int getResultSize()
FullTextQuerylist().size() because list() if the index is
not in sync with the database at the time of query.
getResultSize in interface FullTextQuerypublic FullTextQuery setCriteriaQuery(org.hibernate.Criteria criteria)
FullTextQuery
setCriteriaQuery in interface FullTextQuerypublic FullTextQuery setProjection(java.lang.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 FullTextQuerypublic FullTextQuery setFirstResult(int firstResult)
FullTextQuery
setFirstResult in interface org.hibernate.QuerysetFirstResult in interface FullTextQuerysetFirstResult in class org.hibernate.impl.AbstractQueryImplpublic FullTextQuery setMaxResults(int maxResults)
FullTextQuery
setMaxResults in interface org.hibernate.QuerysetMaxResults in interface FullTextQuerysetMaxResults in class org.hibernate.impl.AbstractQueryImplpublic FullTextQuery setFetchSize(int fetchSize)
FullTextQuery
setFetchSize in interface org.hibernate.QuerysetFetchSize in interface FullTextQuerysetFetchSize in class org.hibernate.impl.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.impl.AbstractQueryImplpublic <T> T unwrap(java.lang.Class<T> type)
FullTextQuery
unwrap in interface FullTextQuerypublic org.hibernate.LockOptions getLockOptions()
getLockOptions in class org.hibernate.impl.AbstractQueryImpl
public int executeUpdate()
throws org.hibernate.HibernateException
executeUpdate in interface org.hibernate.Queryorg.hibernate.HibernateException
public org.hibernate.Query setLockMode(java.lang.String alias,
org.hibernate.LockMode lockMode)
setLockMode in interface org.hibernate.Queryprotected java.util.Map getLockModes()
public FullTextFilter enableFullTextFilter(java.lang.String name)
FullTextQuery
enableFullTextFilter in interface FullTextQuerypublic void disableFullTextFilter(java.lang.String name)
FullTextQuery
disableFullTextFilter in interface FullTextQuery
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||