Interface SearchMapping
- All Superinterfaces:
SearchScopeProvider
- 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(AnnotatedTypeSource annotatedTypeSource) static SearchMappingBuilderbuilder(AnnotatedTypeSource annotatedTypeSource, MethodHandles.Lookup lookup) <E> SearchIndexedEntity<E> indexedEntity(Class<E> entityType) indexedEntity(String entityName) indexManager(String indexName) Methods inherited from interface org.hibernate.search.mapper.pojo.standalone.scope.SearchScopeProvider
scope, scope, scope, scope, typedScope, typedScope
-
Method Details
-
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. SeeSearchEntity.name().- 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
- Parameters:
annotatedTypeSource- A source of types to be processed for annotations by Hibernate Search.- Returns:
- A
SearchMappingbuilder. - See Also:
-
builder
static SearchMappingBuilder builder(AnnotatedTypeSource annotatedTypeSource, MethodHandles.Lookup lookup) - Parameters:
annotatedTypeSource- A source of types to be processed for annotations by Hibernate Search.lookup- AMethodHandles.Lookupto perform reflection on mapped types.- Returns:
- A
SearchMappingbuilder. - See Also:
-