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 SearchMappingBuilder
builder
(AnnotatedTypeSource annotatedTypeSource) static SearchMappingBuilder
builder
(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
-
Method Details
-
createSession
SearchSession createSession()- Returns:
- A new session allowing to
index
orsearch for
entities. - 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
SearchIndexedEntity
for 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
SearchIndexedEntity
for 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
SearchIndexedEntity
for each indexed entity
-
indexManager
- Parameters:
indexName
- The name of an index. SeeIndexed.index()
.- Returns:
- The index manager for the index having
indexName
as name.
-
backend
Backend backend()- Returns:
- The default backend, if any.
-
backend
- Parameters:
backendName
- The name of a backend. SeeIndexed.backend()
.- Returns:
- The backend having
backendName
as name.
-
builder
- Parameters:
annotatedTypeSource
- A source of types to be processed for annotations by Hibernate Search.- Returns:
- A
SearchMapping
builder. - 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.Lookup
to perform reflection on mapped types.- Returns:
- A
SearchMapping
builder. - See Also:
-