public interface SearchSession
| Modifier and Type | Method and Description |
|---|---|
MassIndexer |
createIndexer(Class<?>... types)
Creates a
MassIndexer to rebuild the indexes of some or all indexed entity types. |
default <T> SearchScope<T> |
scope(Class<T> type)
Create a
SearchScope limited to the given type. |
<T> SearchScope<T> |
scope(Collection<? extends Class<? extends T>> types)
Create a
SearchScope limited to the given types. |
default <T> HibernateOrmSearchQueryResultDefinitionContext<T> |
search(Class<T> type)
Initiate the building of a search query.
|
default <T> HibernateOrmSearchQueryResultDefinitionContext<T> |
search(Collection<? extends Class<? extends T>> types)
Initiate the building of a search query.
|
void |
setAutomaticIndexingSynchronizationStrategy(AutomaticIndexingSynchronizationStrategy synchronizationStrategy)
Set the
AutomaticIndexingSynchronizationStrategy to use for this session. |
EntityManager |
toEntityManager() |
Session |
toOrmSession() |
default <T> HibernateOrmSearchQueryResultDefinitionContext<T> search(Class<T> type)
The query will target the indexes mapped to the given type, or to any of its sub-types.
T - An indexed type, or a supertype of all indexed types that will be targeted by the search query.type - An indexed type, or a supertype of all indexed types that will be targeted by the search query.get the resulting query.HibernateOrmSearchQueryResultDefinitionContextdefault <T> HibernateOrmSearchQueryResultDefinitionContext<T> search(Collection<? extends Class<? extends T>> types)
The query will target the indexes mapped to the given types, or to any of their sub-types.
T - A supertype of all indexed types that will be targeted by the search query.types - A collection of indexed types, or supertypes of all indexed types that will be targeted by the search query.get the resulting query.HibernateOrmSearchQueryResultDefinitionContextdefault <T> SearchScope<T> scope(Class<T> type)
SearchScope limited to the given type.T - A type to include in the scope.type - A type to include in the scope.SearchScope<T> SearchScope<T> scope(Collection<? extends Class<? extends T>> types)
SearchScope limited to the given types.T - A supertype of all types to include in the scope.types - A collection of types to include in the scope.SearchScopeMassIndexer createIndexer(Class<?>... types)
MassIndexer to rebuild the indexes of some or all indexed entity types.
The indexer will apply to the indexes mapped to the given types, or to any of their sub-types.
MassIndexer instances cannot be reused.
types - An array of indexed types, or supertypes of all indexed types that will be reindexed.
If empty, all indexed types will be reindexed.EntityManager toEntityManager()
EntityManager used by this SearchSession.Session toOrmSession()
Session used by this SearchSession.void setAutomaticIndexingSynchronizationStrategy(AutomaticIndexingSynchronizationStrategy synchronizationStrategy)
AutomaticIndexingSynchronizationStrategy to use for this session.
Behavior is undefined if called while entity changes are pending: be sure to call this only just after creating a session, or just after committing a transaction.
synchronizationStrategy - The synchronization strategy to useAutomaticIndexingSynchronizationStrategyCopyright © 2006-2019 Red Hat, Inc. and others. Licensed under the GNU Lesser General Public License (LGPL), version 2.1 or later.