The base interface for lucene powered searches.
This extends the JPA Query interface
| Method from org.hibernate.search.jpa.FullTextQuery Detail: |
public void disableFullTextFilter(String name)
Disable a given filter by its name |
public FullTextFilter enableFullTextFilter(String name)
Enable a given filter by its name. Returns a FullTextFilter object that allows filter parameter injection |
public Explanation explain(int documentId)
|
public 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. |
public FullTextQuery setCriteriaQuery(Criteria criteria)
Defines the Database Query used to load the Lucene results.
Useful to load a given object graph by refining the fetch modes
No projection (criteria.setProjection() ) allowed, the root entity must be the only returned type
No where restriction can be defined either. |
public FullTextQuery setFilter(Filter filter)
Allows to use lucene filters.
Semi-deprecated? a preferred way is to use the @FullTextFilterDef approach |
public 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).
A projectable field must be stored in the Lucene index and use a org.hibernate.search.bridge.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[] |
public FullTextQuery setResultTransformer(ResultTransformer transformer)
defines a result transformer used during projection |
public FullTextQuery setSort(Sort sort)
Allows to let lucene sort the results. This is useful when you have
additional sort requirements on top of the default lucene ranking.
Without lucene sorting you would have to retrieve the full result set and
order the hibernate objects. |