Interface SearchMapping
- All Known Subinterfaces:
CloseableSearchMapping
The Hibernate Search mapping between the POJO model and the backend(s).
Provides entry points to Hibernate Search operations that are not tied to a specific session.
-
Method Summary
Modifier and TypeMethodDescriptionCollection<? extends SearchIndexedEntity<?>>backend()static SearchMappingBuilderbuilder()static SearchMappingBuilderbuilder(MethodHandles.Lookup lookup) <E> SearchIndexedEntity<E>indexedEntity(Class<E> entityType) indexedEntity(String entityName) indexManager(String indexName) default <T> SearchScope<T>Create aSearchScopelimited to the given type.<T> SearchScope<T>scope(Collection<? extends Class<? extends T>> types) Create aSearchScopelimited to the given types.
-
Method Details
-
scope
Create aSearchScopelimited to the given type.- Type Parameters:
T- A type to include in the scope.- Parameters:
type- A type to include in the scope.- Returns:
- The created scope.
- See Also:
-
scope
Create aSearchScopelimited to the given types.- Type Parameters:
T- A supertype of all types to include in the scope.- Parameters:
types- A collection of types to include in the scope.- Returns:
- The created scope.
- See Also:
-
createSession
SearchSession createSession()- Returns:
- A new session allowing to
indexorsearch forentities. - See Also:
-
createSessionWithOptions
SearchSessionBuilder createSessionWithOptions()- Returns:
- A session builder allowing to more finely configure the new session.
- See Also:
-
indexedEntity
- Type Parameters:
E- The type of an indexed entity.- Parameters:
entityType- The type of an indexed entity. This must be the exact type; passing the type of a mapped-superclass for example will not work.- Returns:
- A
SearchIndexedEntityfor the indexed entity with the exact given type. - Throws:
SearchException- If the type does not match any indexed entity.
-
indexedEntity
- Parameters:
entityName- The name of an indexed entity. SeeStandalonePojoMappingConfigurationContext.addEntityType(Class, String).- Returns:
- A
SearchIndexedEntityfor the indexed entity with the given name. - Throws:
SearchException- If the name does not match any indexed entity.
-
allIndexedEntities
Collection<? extends SearchIndexedEntity<?>> allIndexedEntities()- Returns:
- A collection containing one
SearchIndexedEntityfor each indexed entity
-
indexManager
- Parameters:
indexName- The name of an index. SeeIndexed.index().- Returns:
- The index manager for the index having
indexNameas name.
-
backend
Backend backend()- Returns:
- The default backend, if any.
-
backend
- Parameters:
backendName- The name of a backend. SeeIndexed.backend().- Returns:
- The backend having
backendNameas name.
-
builder
- Returns:
- A
SearchMappingbuilder.
-
builder
- Parameters:
lookup- AMethodHandles.Lookupto perform reflection on entities.- Returns:
- A
SearchMappingbuilder.
-