|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.hibernate.search.jpa.impl.FullTextQueryImpl
public class FullTextQueryImpl
Field Summary |
---|
Fields inherited from interface org.hibernate.search.ProjectionConstants |
---|
BOOST, DOCUMENT, DOCUMENT_ID, EXPLANATION, ID, OBJECT_CLASS, SCORE, THIS |
Constructor Summary | |
---|---|
FullTextQueryImpl(FullTextQuery query,
org.hibernate.Session session)
|
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 |
List |
getResultList()
|
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. |
Object |
getSingleResult()
|
FullTextQuery |
setCriteriaQuery(org.hibernate.Criteria criteria)
Defines the Database Query used to load the Lucene results. |
FullTextQuery |
setFilter(org.apache.lucene.search.Filter filter)
Allows to use lucene filters. |
javax.persistence.Query |
setFirstResult(int firstResult)
|
javax.persistence.Query |
setFlushMode(javax.persistence.FlushModeType flushMode)
|
javax.persistence.Query |
setHint(String hintName,
Object value)
|
javax.persistence.Query |
setMaxResults(int maxResult)
|
javax.persistence.Query |
setParameter(int position,
Calendar value,
javax.persistence.TemporalType temporalType)
|
javax.persistence.Query |
setParameter(int position,
Date value,
javax.persistence.TemporalType temporalType)
|
javax.persistence.Query |
setParameter(int position,
Object value)
|
javax.persistence.Query |
setParameter(String name,
Calendar value,
javax.persistence.TemporalType temporalType)
|
javax.persistence.Query |
setParameter(String name,
Date value,
javax.persistence.TemporalType temporalType)
|
javax.persistence.Query |
setParameter(String name,
Object value)
|
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 |
FullTextQuery |
setSort(org.apache.lucene.search.Sort sort)
Allows to let lucene sort the results. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FullTextQueryImpl(FullTextQuery query, org.hibernate.Session session)
Method Detail |
---|
public FullTextQuery setSort(org.apache.lucene.search.Sort sort)
FullTextQuery
setSort
in interface FullTextQuery
sort
- The lucene sort object.
public FullTextQuery setFilter(org.apache.lucene.search.Filter filter)
FullTextQuery
setFilter
in interface FullTextQuery
filter
- The lucene filter.
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 FullTextFilter enableFullTextFilter(String name)
FullTextQuery
enableFullTextFilter
in interface FullTextQuery
public void disableFullTextFilter(String name)
FullTextQuery
disableFullTextFilter
in interface FullTextQuery
public FullTextQuery setResultTransformer(org.hibernate.transform.ResultTransformer transformer)
FullTextQuery
setResultTransformer
in interface FullTextQuery
public List getResultList()
getResultList
in interface javax.persistence.Query
public Object getSingleResult()
getSingleResult
in interface javax.persistence.Query
public javax.persistence.Query setMaxResults(int maxResult)
setMaxResults
in interface javax.persistence.Query
public javax.persistence.Query setFirstResult(int firstResult)
setFirstResult
in interface javax.persistence.Query
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 executeUpdate()
executeUpdate
in interface javax.persistence.Query
public javax.persistence.Query setHint(String hintName, Object value)
setHint
in interface javax.persistence.Query
public javax.persistence.Query setParameter(String name, Object value)
setParameter
in interface javax.persistence.Query
public javax.persistence.Query setParameter(String name, Date value, javax.persistence.TemporalType temporalType)
setParameter
in interface javax.persistence.Query
public javax.persistence.Query setParameter(String name, Calendar value, javax.persistence.TemporalType temporalType)
setParameter
in interface javax.persistence.Query
public javax.persistence.Query setParameter(int position, Object value)
setParameter
in interface javax.persistence.Query
public javax.persistence.Query setParameter(int position, Date value, javax.persistence.TemporalType temporalType)
setParameter
in interface javax.persistence.Query
public javax.persistence.Query setParameter(int position, Calendar value, javax.persistence.TemporalType temporalType)
setParameter
in interface javax.persistence.Query
public javax.persistence.Query setFlushMode(javax.persistence.FlushModeType flushMode)
setFlushMode
in interface javax.persistence.Query
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |