Package org.hibernate.search
Interface FullTextQuery
- All Superinterfaces:
org.hibernate.BasicQueryContract,org.hibernate.query.CommonQueryContract,FullTextQuery,ProjectionConstants,javax.persistence.Query,org.hibernate.Query,org.hibernate.query.Query,org.hibernate.query.spi.QueryImplementor,javax.persistence.TypedQuery
@Deprecated
public interface FullTextQuery
extends FullTextQuery, org.hibernate.query.spi.QueryImplementor
Deprecated.
The base interface for full-text queries using the Hibernate ORM API (
Query).
This also extends the JPA counterpart, FullTextQuery.
- Author:
- Hardy Ferentschik, Emmanuel Bernard
-
Field Summary
Fields inherited from interface org.hibernate.search.engine.ProjectionConstants
DOCUMENT, EXPLANATION, ID, OBJECT_CLASS, SCORE, SPATIAL_DISTANCE, THIS -
Method Summary
Modifier and TypeMethodDescriptiondefault FullTextQueryapplyFetchGraph(org.hibernate.graph.RootGraph graph) Deprecated.applyGraph(org.hibernate.graph.RootGraph graph, org.hibernate.graph.GraphSemantic semantic) Deprecated.default FullTextQueryapplyLoadGraph(org.hibernate.graph.RootGraph graph) Deprecated.initializeObjectsWith(ObjectLookupMethod lookupMethod, DatabaseRetrievalMethod retrievalMethod) Deprecated.Refine the strategies used to load entities.limitExecutionTimeTo(long timeout, TimeUnit timeUnit) Deprecated.Limit the time used by Hibernate Search to execute the query.setFetchSize(int i) Deprecated.Instead of using Hibernate Search 5 APIs, get aSearchSessionusingSearch.session(EntityManager), create a search query withSearchSession.search(Class), and define your loading options usingSearchQueryOptionsStep.loading(Consumer).setFirstResult(int firstResult) Deprecated.setFlushMode(javax.persistence.FlushModeType flushMode) Deprecated.Deprecated.setMaxResults(int maxResults) Deprecated.setProjection(String... fields) Deprecated.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).setResultTransformer(org.hibernate.transform.ResultTransformer transformer) Deprecated.Instead of using Hibernate Search 5 APIs, get aSearchSessionusingSearch.session(Session), create a search query withSearchSession.search(Class), and define your projections usingSearchQuerySelectStep.select(Function).Deprecated.Allows to let lucene sort the results.setSpatialParameters(double latitude, double longitude, String fieldName) Deprecated.Defines the center of the spatial search for this query to project distance in resultssetSpatialParameters(Coordinates center, String fieldName) Deprecated.Defines the center of the spatial search for this query to project distance in resultssetTimeout(long timeout, TimeUnit timeUnit) Deprecated.Define a timeout period for a given unit of time.<T> TDeprecated.Methods inherited from interface org.hibernate.search.jpa.FullTextQuery
explain, getFacetManager, getResultSize, hasPartialResultsMethods inherited from interface javax.persistence.Query
executeUpdate, getFirstResult, getHints, getLockMode, getMaxResults, getParameter, getParameter, getParameter, getParameter, getParameters, getParameterValue, getParameterValue, getParameterValue, isBoundMethods inherited from interface org.hibernate.Query
determineProperBooleanType, determineProperBooleanType, getFlushMode, getHibernateFirstResult, getHibernateMaxResults, getNamedParameters, getQueryOptions, getReturnAliases, getReturnTypes, getTimeout, isCacheable, isReadOnly, iterate, setHibernateFirstResult, setHibernateMaxResults, setParameterList, setParameterList, setParameterList, setParameterListMethods inherited from interface org.hibernate.query.Query
addQueryHint, getCacheMode, getCacheRegion, getComment, getFetchSize, getHibernateFlushMode, getLockOptions, getParameterMetadata, getQueryString, getResultList, getResultStream, getSingleResult, list, scroll, scroll, 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, setHibernateFlushMode, setInteger, setInteger, setLocale, setLocale, setLockMode, setLockMode, setLockOptions, setLong, setLong, setParameter, setParameter, setParameter, setParameter, setParameter, setParameter, setParameter, setParameter, setParameter, setParameter, setParameter, setParameter, setParameter, setParameter, setParameter, setParameter, setParameter, setParameter, setParameter, setParameter, setParameter, setParameter, setParameter, setParameter, setParameter, setParameter, setParameter, setParameter, setParameterList, setParameterList, setParameterList, setParameterList, setParameterList, setParameters, setProperties, setProperties, setReadOnly, setSerializable, setSerializable, setShort, setShort, setString, setString, setText, setText, setTime, setTime, setTimeout, setTimestamp, setTimestamp, stream, uniqueResult, uniqueResultOptionalMethods inherited from interface org.hibernate.query.spi.QueryImplementor
getProducer, setOptionalEntityName, setOptionalId, setOptionalObject
-
Method Details
-
setResultTransformer
@Deprecated FullTextQuery setResultTransformer(org.hibernate.transform.ResultTransformer transformer) Deprecated.Instead of using Hibernate Search 5 APIs, get aSearchSessionusingSearch.session(Session), create a search query withSearchSession.search(Class), and define your projections usingSearchQuerySelectStep.select(Function). See in particular the composite projection, which allows applying a function to another projection:SearchProjectionFactory.composite(). Refer to the migration guide for more information.defines a result transformer used during projection, the Aliases provided are the projection aliases.- Specified by:
setResultTransformerin interfaceFullTextQuery- Specified by:
setResultTransformerin interfaceorg.hibernate.Query- Specified by:
setResultTransformerin interfaceorg.hibernate.query.Query- Parameters:
transformer- theResultTransformerto use during projection- Returns:
thisfor method chaining
-
unwrap
Deprecated.- Specified by:
unwrapin interfacejavax.persistence.Query- Type Parameters:
T- the type of the unwrapped object- Parameters:
type- the type to unwrap- Returns:
- the underlying type if possible. If not possible to unwrap to the given type an
IllegalArgumentExceptionis thrown. Supported types are:- org.apache.lucene.search.Query the underlying lucene query
-
setSort
Deprecated.Description copied from interface:FullTextQueryAllows 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.- Specified by:
setSortin interfaceFullTextQuery- Parameters:
sort- The lucene sort object.- Returns:
- this for method chaining
-
applyGraph
FullTextQuery applyGraph(org.hibernate.graph.RootGraph graph, org.hibernate.graph.GraphSemantic semantic) Deprecated.- Specified by:
applyGraphin interfaceorg.hibernate.query.Query
-
applyFetchGraph
Deprecated.- Specified by:
applyFetchGraphin interfaceorg.hibernate.query.Query
-
applyLoadGraph
Deprecated.- Specified by:
applyLoadGraphin interfaceorg.hibernate.query.Query
-
setProjection
Deprecated.Description copied from interface:FullTextQueryDefines 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 two-way field bridge 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[]- Specified by:
setProjectionin interfaceFullTextQuery- Parameters:
fields- the fields to use for projection- Returns:
thisfor method chaining
-
setSpatialParameters
Deprecated.Description copied from interface:FullTextQueryDefines the center of the spatial search for this query to project distance in results- Specified by:
setSpatialParametersin interfaceFullTextQuery- Parameters:
latitude- latitude of the search centerlongitude- longitude of the search centerfieldName- name of the spatial field- Returns:
thisfor method chaining
-
setSpatialParameters
Deprecated.Description copied from interface:FullTextQueryDefines the center of the spatial search for this query to project distance in results- Specified by:
setSpatialParametersin interfaceFullTextQuery- Parameters:
center- the search centerfieldName- name of the spatial field- Returns:
thisfor method chaining
-
setFirstResult
Deprecated.Description copied from interface:FullTextQuery- Specified by:
setFirstResultin interfaceFullTextQuery- Specified by:
setFirstResultin interfacejavax.persistence.Query- Specified by:
setFirstResultin interfaceorg.hibernate.Query- Specified by:
setFirstResultin interfaceorg.hibernate.query.Query- Specified by:
setFirstResultin interfacejavax.persistence.TypedQuery
-
setMaxResults
Deprecated.Description copied from interface:FullTextQuery- Specified by:
setMaxResultsin interfaceFullTextQuery- Specified by:
setMaxResultsin interfacejavax.persistence.Query- Specified by:
setMaxResultsin interfaceorg.hibernate.Query- Specified by:
setMaxResultsin interfaceorg.hibernate.query.Query- Specified by:
setMaxResultsin interfacejavax.persistence.TypedQuery
-
setHint
Deprecated.- Specified by:
setHintin interfaceFullTextQuery- Specified by:
setHintin interfacejavax.persistence.Query- Specified by:
setHintin interfaceorg.hibernate.Query- Specified by:
setHintin interfaceorg.hibernate.query.Query- Specified by:
setHintin interfacejavax.persistence.TypedQuery
-
setFlushMode
Deprecated.- Specified by:
setFlushModein interfaceFullTextQuery- Specified by:
setFlushModein interfacejavax.persistence.Query- Specified by:
setFlushModein interfaceorg.hibernate.Query- Specified by:
setFlushModein interfaceorg.hibernate.query.Query- Specified by:
setFlushModein interfacejavax.persistence.TypedQuery
-
setFetchSize
Deprecated.Instead of using Hibernate Search 5 APIs, get aSearchSessionusingSearch.session(EntityManager), create a search query withSearchSession.search(Class), and define your loading options usingSearchQueryOptionsStep.loading(Consumer). To set the equivalent tosetFetchSize(int)in Hibernate Search 6, useSearchLoadingOptionsStep.fetchSize(int). Refer to the migration guide for more information.- Specified by:
setFetchSizein interfaceorg.hibernate.BasicQueryContract- Specified by:
setFetchSizein interfaceorg.hibernate.Query- Specified by:
setFetchSizein interfaceorg.hibernate.query.Query
-
setTimeout
Deprecated.Description copied from interface:FullTextQueryDefine a timeout period for a given unit of time. Note that this is time out is on a best effort basis. When the query goes beyond the timeout, aQueryTimeoutExceptionis raised.- Specified by:
setTimeoutin interfaceFullTextQuery- Parameters:
timeout- time out periodtimeUnit- time out unit- Returns:
thisto allow method chaining
-
limitExecutionTimeTo
Deprecated.Description copied from interface:FullTextQueryLimit the time used by Hibernate Search to execute the query. When the limit is reached, results already fetched are returned. This time limit is a best effort. The query will likely run for longer than the provided time. The time limit only applies to the interactions between Hibernate Search and Lucene. In other words, a query to the database will not be limited. If the limit is reached and all results are not yet fetched,FullTextQuery.hasPartialResults()returns true.- Specified by:
limitExecutionTimeToin interfaceFullTextQuery- Parameters:
timeout- time out periodtimeUnit- time out unit- Returns:
thisfor method chaining
-
initializeObjectsWith
FullTextQuery initializeObjectsWith(ObjectLookupMethod lookupMethod, DatabaseRetrievalMethod retrievalMethod) Deprecated.Description copied from interface:FullTextQueryRefine the strategies used to load entities. The lookup method defines whether or not to lookup first in the second level cache or the persistence context before trying to initialize objects from the database. Defaults to SKIP. The database retrieval method defines how objects are loaded from the database. Defaults to QUERY. Note that Hibernate Search can deviate from these choices when it makes sense.- Specified by:
initializeObjectsWithin interfaceFullTextQuery- Parameters:
lookupMethod- lookup methodretrievalMethod- how to initilize an object- Returns:
thisfor method chaining
-
SearchSessionusingSearch.session(Session), then create aSearchQuerywithSearchSession.search(Class). If you really need an adapter to Hibernate ORM'sQuerytype, convert thatSearchQueryusingSearch.toOrmQuery(SearchQuery), but be aware that only part of the contract is implemented. Refer to the migration guide for more information.