|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface FullTextQuery
The base interface for Lucene powered searches.
Field Summary |
---|
Fields inherited from interface org.hibernate.search.ProjectionConstants |
---|
DOCUMENT, DOCUMENT_ID, EXPLANATION, ID, OBJECT_CLASS, SCORE, THIS |
Method Summary | ||
---|---|---|
void |
disableFullTextFilter(String name)
Disable a given filter by its name. |
|
FullTextFilter |
enableFullTextFilter(String name)
Enable a given filter by its name. |
|
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()
|
|
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(org.apache.lucene.search.Filter filter)
Allows to use lucene filters. |
|
FullTextQuery |
setFirstResult(int firstResult)
Query.setFirstResult(int) |
|
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(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 |
setTimeout(long timeout,
TimeUnit timeUnit)
Define a timeout period for a given unit of time. |
|
|
unwrap(Class<T> type)
|
Method Detail |
---|
FullTextQuery setSort(org.apache.lucene.search.Sort sort)
sort
- The lucene sort object.
FullTextQuery setFilter(org.apache.lucene.search.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 results
this
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 on
this
for method chainingFullTextFilter enableFullTextFilter(String name)
name
- the name of the filter to enable
FullTextFilter
object that allows filter parameter injection
SearchException
- in case the filter with the specified name is not definedvoid disableFullTextFilter(String name)
name
- the name of the filter to disable.FacetManager getFacetManager()
org.apache.lucene.search.Explanation explain(int documentId)
Explanation
object describing the score computation for the matching object/document
in the current query
documentId
- Lucene Document id to be explain. This is NOT the object id
Explanation
instanceFullTextQuery setFirstResult(int firstResult)
Query.setFirstResult(int)
setFirstResult
in interface Query
FullTextQuery setMaxResults(int maxResults)
Query.setMaxResults(int)
setMaxResults
in interface Query
FullTextQuery setFetchSize(int i)
setFetchSize
in interface Query
FullTextQuery setResultTransformer(ResultTransformer transformer)
setResultTransformer
in interface Query
<T> T unwrap(Class<T> type)
type
- the type to unwrap
IllegalArgumentException
is thrown. Supported types are:
FullTextQuery setTimeout(long timeout, TimeUnit timeUnit)
QueryTimeoutException
is raised.
timeout
- time out periodtimeUnit
- time out unit
this
to allow method chainingFullTextQuery limitExecutionTimeTo(long timeout, TimeUnit timeUnit)
hasPartialResults()
returns true.
timeout
- time out periodtimeUnit
- time out unit
this
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)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |