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.Instead of using Hibernate Search 5 APIs, get aSearchSessionusingSearch.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.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
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description default FullTextQueryapplyFetchGraph(org.hibernate.graph.RootGraph graph)Deprecated.FullTextQueryapplyGraph(org.hibernate.graph.RootGraph graph, org.hibernate.graph.GraphSemantic semantic)Deprecated.default FullTextQueryapplyLoadGraph(org.hibernate.graph.RootGraph graph)Deprecated.FullTextQueryinitializeObjectsWith(ObjectLookupMethod lookupMethod, DatabaseRetrievalMethod retrievalMethod)Deprecated.Refine the strategies used to load entities.FullTextQuerylimitExecutionTimeTo(long timeout, TimeUnit timeUnit)Deprecated.Limit the time used by Hibernate Search to execute the query.FullTextQuerysetFetchSize(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).FullTextQuerysetFirstResult(int firstResult)Deprecated.FullTextQuerysetFlushMode(javax.persistence.FlushModeType flushMode)Deprecated.FullTextQuerysetHint(String hintName, Object value)Deprecated.FullTextQuerysetMaxResults(int maxResults)Deprecated.FullTextQuerysetProjection(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).FullTextQuerysetResultTransformer(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).FullTextQuerysetSort(Sort sort)Deprecated.Allows to let lucene sort the results.FullTextQuerysetSpatialParameters(double latitude, double longitude, String fieldName)Deprecated.Defines the center of the spatial search for this query to project distance in resultsFullTextQuerysetSpatialParameters(Coordinates center, String fieldName)Deprecated.Defines the center of the spatial search for this query to project distance in resultsFullTextQuerysetTimeout(long timeout, TimeUnit timeUnit)Deprecated.Define a timeout period for a given unit of time.<T> Tunwrap(Class<T> type)Deprecated.-
Methods inherited from interface org.hibernate.search.jpa.FullTextQuery
explain, getFacetManager, getResultSize, hasPartialResults
-
Methods inherited from interface javax.persistence.Query
executeUpdate, getFirstResult, getHints, getLockMode, getMaxResults, getParameter, getParameter, getParameter, getParameter, getParameters, getParameterValue, getParameterValue, getParameterValue, isBound
-
Methods inherited from interface org.hibernate.Query
determineProperBooleanType, determineProperBooleanType, getFlushMode, getHibernateFirstResult, getHibernateMaxResults, getNamedParameters, getQueryOptions, getReturnAliases, getReturnTypes, getTimeout, isCacheable, isReadOnly, iterate, setHibernateFirstResult, setHibernateMaxResults, setParameterList, setParameterList, setParameterList, setParameterList
-
Methods 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, uniqueResultOptional
-
-
-
-
Method Detail
-
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(Function, ProjectionFinalStep). 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
<T> T unwrap(Class<T> type)
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
FullTextQuery setSort(Sort sort)
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
default FullTextQuery applyFetchGraph(org.hibernate.graph.RootGraph graph)
Deprecated.- Specified by:
applyFetchGraphin interfaceorg.hibernate.query.Query
-
applyLoadGraph
default FullTextQuery applyLoadGraph(org.hibernate.graph.RootGraph graph)
Deprecated.- Specified by:
applyLoadGraphin interfaceorg.hibernate.query.Query
-
setProjection
FullTextQuery setProjection(String... fields)
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
FullTextQuery setSpatialParameters(double latitude, double longitude, String fieldName)
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
FullTextQuery setSpatialParameters(Coordinates center, String fieldName)
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
FullTextQuery setFirstResult(int firstResult)
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
FullTextQuery setMaxResults(int maxResults)
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
FullTextQuery setHint(String hintName, Object value)
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
FullTextQuery setFlushMode(javax.persistence.FlushModeType flushMode)
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
FullTextQuery 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). 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
FullTextQuery setTimeout(long timeout, TimeUnit timeUnit)
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
FullTextQuery limitExecutionTimeTo(long timeout, TimeUnit timeUnit)
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
-
-