|
||||||||||
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,
Class<?>[] classes,
org.hibernate.engine.SessionImplementor session,
org.hibernate.engine.query.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 |
protected Map |
getLockModes()
|
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. |
Iterator |
iterate()
Return an interator on the results. |
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(String alias,
org.hibernate.LockMode lockMode)
|
FullTextQuery |
setMaxResults(int maxResults)
{link:Query#setMaxResults} |
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. |
Methods inherited from class org.hibernate.impl.AbstractQueryImpl |
---|
after, before, determineType, determineType, determineType, determineType, determineType, expandParameterLists, getNamedParameterLists, getNamedParameters, getNamedParams, 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, 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, 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 FullTextQuery
sort
- The lucene sort object.
public FullTextQuery setFilter(org.apache.lucene.search.Filter filter)
setFilter
in interface FullTextQuery
filter
- The lucene filter.
public Iterator iterate() throws org.hibernate.HibernateException
iterate
in interface org.hibernate.Query
org.hibernate.HibernateException
public org.hibernate.ScrollableResults scroll() throws org.hibernate.HibernateException
scroll
in interface org.hibernate.Query
org.hibernate.HibernateException
public org.hibernate.ScrollableResults scroll(org.hibernate.ScrollMode scrollMode) throws org.hibernate.HibernateException
scroll
in interface org.hibernate.Query
org.hibernate.HibernateException
public List list() throws org.hibernate.HibernateException
list
in interface org.hibernate.Query
org.hibernate.HibernateException
public org.apache.lucene.search.Explanation explain(int documentId)
FullTextQuery
Explanation
object describing the score computation for the matching object/document
in the current query
explain
in interface FullTextQuery
documentId
- Lucene Document id to be explain. This is NOT the object id
public int getResultSize()
FullTextQuery
list().size()
because list() if the index is
not in sync with the database at the time of query.
getResultSize
in interface FullTextQuery
public FullTextQuery setCriteriaQuery(org.hibernate.Criteria criteria)
FullTextQuery
setCriteriaQuery
in interface FullTextQuery
public FullTextQuery setProjection(String... fields)
FullTextQuery
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[]
setProjection
in interface FullTextQuery
public FullTextQuery setFirstResult(int firstResult)
FullTextQuery
setFirstResult
in interface org.hibernate.Query
setFirstResult
in interface FullTextQuery
setFirstResult
in class org.hibernate.impl.AbstractQueryImpl
public FullTextQuery setMaxResults(int maxResults)
FullTextQuery
setMaxResults
in interface org.hibernate.Query
setMaxResults
in interface FullTextQuery
setMaxResults
in class org.hibernate.impl.AbstractQueryImpl
public FullTextQuery setFetchSize(int fetchSize)
FullTextQuery
setFetchSize
in interface org.hibernate.Query
setFetchSize
in interface FullTextQuery
setFetchSize
in class org.hibernate.impl.AbstractQueryImpl
public FullTextQuery setResultTransformer(org.hibernate.transform.ResultTransformer transformer)
FullTextQuery
setResultTransformer
in interface org.hibernate.Query
setResultTransformer
in interface FullTextQuery
setResultTransformer
in class org.hibernate.impl.AbstractQueryImpl
public int executeUpdate() throws org.hibernate.HibernateException
executeUpdate
in interface org.hibernate.Query
org.hibernate.HibernateException
public org.hibernate.Query setLockMode(String alias, org.hibernate.LockMode lockMode)
setLockMode
in interface org.hibernate.Query
protected Map getLockModes()
getLockModes
in class org.hibernate.impl.AbstractQueryImpl
public FullTextFilter enableFullTextFilter(String name)
FullTextQuery
enableFullTextFilter
in interface FullTextQuery
public void disableFullTextFilter(String name)
FullTextQuery
disableFullTextFilter
in interface FullTextQuery
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |