|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface IndexManager
An IndexManager abstracts the specific configuration and implementations being used on a single index. For each index a different implementation can be used, or different configurations. While in previous versions of Hibernate Search the backend could be sync or async, this fact is now considered a detail of the concrete IndexManager implementations. This makes it possible to configure each index manager (and hence index) differently. A concrete implementation can also decide to only support a specific mode of operation. It can ignore some configuration properties or expect additional properties.
| Method Summary | |
|---|---|
void |
addContainedEntity(Class<?> entity)
|
void |
destroy()
Called when a SearchFactory is stopped. |
org.apache.lucene.analysis.Analyzer |
getAnalyzer(String name)
|
Set<Class<?>> |
getContainedTypes()
|
String |
getIndexName()
Useful for labeling and logging resources from this instance. |
ReaderProvider |
getReaderProvider()
Provide access to IndexReaders. |
LuceneWorkSerializer |
getSerializer()
|
org.apache.lucene.search.Similarity |
getSimilarity()
|
void |
initialize(String indexName,
Properties properties,
org.apache.lucene.search.Similarity similarity,
WorkerBuildContext context)
Initialize this IndexManager before its use. |
void |
optimize()
To optimize the underlying index. |
void |
performOperations(List<LuceneWork> queue,
IndexingMonitor monitor)
Used to apply update operations to the index. |
void |
performStreamOperation(LuceneWork singleOperation,
IndexingMonitor monitor,
boolean forceAsync)
Perform a single non-transactional operation, best to stream large amounts of operations. |
void |
setSearchFactory(SearchFactoryImplementor boundSearchFactory)
Connects this IndexManager to a new SearchFactory. |
| Method Detail |
|---|
String getIndexName()
ReaderProvider getReaderProvider()
IndexReaders.
ReaderProvider instance for the index managed by this instance
void performOperations(List<LuceneWork> queue,
IndexingMonitor monitor)
monitor - no be notified of indexing eventsqueue - the list of write operations to apply.
void performStreamOperation(LuceneWork singleOperation,
IndexingMonitor monitor,
boolean forceAsync)
singleOperation - the operation to performmonitor - no be notified of indexing eventsforceAsync - if true, the invocation will not block to wait for it being applied.
When false this will depend on the backend configuration.
void initialize(String indexName,
Properties properties,
org.apache.lucene.search.Similarity similarity,
WorkerBuildContext context)
IndexManager before its use.
indexName - the unique name of the index (manager). Can be used to retrieve a IndexManager instance
via the search factory and IndexManagerHolder.properties - the configuration propertiescontext - context information needed to initialize this index managervoid destroy()
SearchFactory is stopped. This method typically releases resources.
Set<Class<?>> getContainedTypes()
org.apache.lucene.search.Similarity getSimilarity()
Similarity applied to this index. Note, only a single Similarity can be applied to
a given index.org.apache.lucene.analysis.Analyzer getAnalyzer(String name)
name - the name of the analyzer to retrieve.
Analyzer with the given name (see also AnalyzerDef)
SearchException - in case the analyzer name is unknown.void setSearchFactory(SearchFactoryImplementor boundSearchFactory)
IndexManager to a new SearchFactory.
boundSearchFactory - the existing search factory to which to associate this index manager withvoid addContainedEntity(Class<?> entity)
entity - Adds the specified entity type to this index manager, making it responsible for manging this type.void optimize()
LuceneWorkSerializer getSerializer()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||