public interface SearchIntegrator extends AutoCloseable
org.hibernate.search.SearchFactory
contract to
its clients.Modifier and Type | Method and Description |
---|---|
void |
addClasses(Class<?>... classes)
Add the following classes to the SearchIntegrator.
|
QueryContextBuilder |
buildQueryBuilder() |
void |
close()
Shuts down all workers and releases all resources.
|
HSQuery |
createHSQuery()
Deprecated.
This method will be removed. Use
createHSQuery(Query, Class...) |
HSQuery |
createHSQuery(Query luceneQuery,
Class<?>... entityTypes)
Return an Hibernate Search query object.
|
HSQuery |
createHSQuery(Query luceneQuery,
CustomTypeMetadata... types)
Return an Hibernate Search query object.
|
Analyzer |
getAnalyzer(Class<?> clazz)
Retrieves the scoped analyzer for a given class.
|
Analyzer |
getAnalyzer(String name)
Retrieve an analyzer instance by its definition name
|
TimeoutExceptionFactory |
getDefaultTimeoutExceptionFactory()
Useful if you need to create custom exception types to represent query timeouts.
|
ErrorHandler |
getErrorHandler()
Used to catch exceptions in all synchronous operations; but default they are logged, the user
can configure alternative error management means.
|
EntityIndexBinding |
getIndexBinding(Class<?> entityType)
Returns the entity to index binding for the given type.
|
IndexedTypeDescriptor |
getIndexedTypeDescriptor(Class<?> entityType)
Returns a descriptor for the specified entity type describing its indexed state.
|
Set<Class<?>> |
getIndexedTypes()
Returns the set of currently indexed types.
|
IndexingMode |
getIndexingMode() |
IndexManager |
getIndexManager(String indexName)
Get an
IndexManager using the name |
IndexReaderAccessor |
getIndexReaderAccessor()
Provides access to the IndexReader API
|
ServiceManager |
getServiceManager()
Returns the service manager.
|
Statistics |
getStatistics()
Retrieve the statistics instance for this factory.
|
Worker |
getWorker()
The Worker is the entry point to apply writes and updates to the indexes.
|
LuceneWorkSerializer |
getWorkSerializer() |
boolean |
isStopped() |
BatchBackend |
makeBatchBackend(MassIndexerProgressMonitor progressMonitor) |
void |
optimize()
Optimize all indexes
|
void |
optimize(Class entityType)
Optimize the index holding
entityType |
<T> T |
unwrap(Class<T> cls)
Unwraps some internal Hibernate Search types.
|
EntityIndexBinding getIndexBinding(Class<?> entityType)
entityType
- the type for which to retrieve the bindingnull
is returned for types which are unindexed or
unknown.void addClasses(Class<?>... classes)
classes
- the classes to add to the SearchIntegrator
@Deprecated HSQuery createHSQuery()
createHSQuery(Query, Class...)
HSQuery createHSQuery(Query luceneQuery, Class<?>... entityTypes)
Be aware that some backends may not implement HSQuery.luceneQuery(Query)
,
in which case the query provided here cannot be overridden.
Calling HSQuery.targetedEntities(java.util.List)
on the resulting query
is not necessary, unless you later decide to target a subset of entities
.
HSQuery createHSQuery(Query luceneQuery, CustomTypeMetadata... types)
Be aware that some backends may not implement HSQuery.luceneQuery(Query)
,
in which case the query provided here cannot be overridden.
Calling HSQuery.targetedTypes(java.util.List)
on the resulting query
is not necessary, unless you later decide to target a subset of entities
.
boolean isStopped()
ErrorHandler getErrorHandler()
TimeoutExceptionFactory getDefaultTimeoutExceptionFactory()
void optimize()
void optimize(Class entityType)
entityType
entityType
- the entity type (index) to optimizeAnalyzer getAnalyzer(String name)
name
- the name of the analyzerSearchException
- if the definition name is unknownAnalyzer getAnalyzer(Class<?> clazz)
clazz
- The class for which to retrieve the analyzer.IllegalArgumentException
- in case clazz == null
or the specified
class is not an indexed entity.QueryContextBuilder buildQueryBuilder()
Statistics getStatistics()
IndexReaderAccessor getIndexReaderAccessor()
IndexedTypeDescriptor getIndexedTypeDescriptor(Class<?> entityType)
entityType
- the entity for which to retrieve the descriptornull
IndexedEntityDescriptor
. This method can also be called for non indexed types.
To determine whether the entity is actually indexed IndexedTypeDescriptor.isIndexed()
can be used.IllegalArgumentException
- in case entityType
is null
Set<Class<?>> getIndexedTypes()
<T> T unwrap(Class<T> cls)
T
- the type of the unwrapped objectcls
- the class of the internal object to unwrapServiceManager getServiceManager()
Worker getWorker()
Worker
void close()
close
in interface AutoCloseable
IndexManager getIndexManager(String indexName)
IndexManager
using the nameindexName
- the name of the IndexManager
IndexManager
IndexingMode getIndexingMode()
Environment.INDEXING_STRATEGY
.BatchBackend makeBatchBackend(MassIndexerProgressMonitor progressMonitor)
LuceneWorkSerializer getWorkSerializer()
Copyright © 2006-2017 Red Hat, Inc. All Rights Reserved