|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.hibernate.search.indexes.impl.DirectoryBasedIndexManager
public class DirectoryBasedIndexManager
This implementation of IndexManager is coupled to a DirectoryProvider and a DirectoryBasedReaderProvider
| Constructor Summary | |
|---|---|
DirectoryBasedIndexManager()
|
|
| Method Summary | |
|---|---|
void |
addContainedEntity(Class<?> entity)
|
protected BackendQueueProcessor |
createBackend(String indexName,
Properties cfg,
WorkerBuildContext buildContext)
extensions points from initialize(String, Properties, WorkerBuildContext) |
protected DirectoryProvider |
createDirectoryProvider(String indexName,
Properties cfg,
WorkerBuildContext buildContext)
|
protected DirectoryBasedReaderProvider |
createIndexReader(String indexName,
Properties cfg,
WorkerBuildContext buildContext)
|
void |
destroy()
Called when a SearchFactory is stopped. |
org.apache.lucene.analysis.Analyzer |
getAnalyzer(String name)
|
BackendQueueProcessor |
getBackendQueueProcessor()
|
Set<Class<?>> |
getContainedTypes()
|
Lock |
getDirectoryModificationLock()
|
DirectoryProvider |
getDirectoryProvider()
|
EntityIndexBinder |
getIndexBindingForEntity(Class<?> entityType)
|
LuceneIndexingParameters |
getIndexingParameters()
|
String |
getIndexName()
Useful for labeling and logging resources from this instance. |
OptimizerStrategy |
getOptimizerStrategy()
|
ReaderProvider |
getReaderProvider()
Provide access to IndexReaders. |
LuceneWorkSerializer |
getSerializer()
|
org.apache.lucene.search.Similarity |
getSimilarity()
|
void |
initialize(String indexName,
Properties cfg,
WorkerBuildContext buildContext)
Initialize the IndexManager before its use. |
void |
optimize()
To optimize the underlying index. |
void |
performOperations(List<LuceneWork> workList,
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 |
setIndexWriterConfig(org.apache.lucene.index.IndexWriterConfig writerConfig)
|
void |
setSearchFactory(SearchFactoryImplementor boundSearchFactory)
Connects this IndexManager to a new SearchFactory. |
void |
setSimilarity(org.apache.lucene.search.Similarity newSimilarity)
Not intended to be a mutable option, but the Similarity might be defined later in the boot lifecycle. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public DirectoryBasedIndexManager()
| Method Detail |
|---|
public String getIndexName()
IndexManager
getIndexName in interface IndexManagerpublic ReaderProvider getReaderProvider()
IndexManagerIndexReaders.
getReaderProvider in interface IndexManagerReaderProvider instance for the index managed by this instancepublic void destroy()
IndexManagerSearchFactory is stopped. This method typically releases resources.
destroy in interface IndexManager
public void initialize(String indexName,
Properties cfg,
WorkerBuildContext buildContext)
IndexManager
initialize in interface IndexManagerindexName - The unique name of the index (manager). Can be used to retrieve a IndexManager instance
via the search factory and IndexManagerHolder.cfg - The configuration propertiesbuildContext - context information needed to initialize this index managerpublic Set<Class<?>> getContainedTypes()
getContainedTypes in interface IndexManagerpublic org.apache.lucene.search.Similarity getSimilarity()
getSimilarity in interface IndexManagerSimilarity applied to this index. Note, only a single Similarity can be applied to
a given index.public void setSimilarity(org.apache.lucene.search.Similarity newSimilarity)
IndexManager
setSimilarity in interface IndexManagernewSimilarity - the new similarity value
public void performStreamOperation(LuceneWork singleOperation,
IndexingMonitor monitor,
boolean forceAsync)
IndexManager
performStreamOperation in interface IndexManagersingleOperation - 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.
public void performOperations(List<LuceneWork> workList,
IndexingMonitor monitor)
IndexManager
performOperations in interface IndexManagerworkList - the list of write operations to apply.monitor - no be notified of indexing eventspublic String toString()
toString in class Objectpublic org.apache.lucene.analysis.Analyzer getAnalyzer(String name)
getAnalyzer in interface IndexManagername - the name of the analyzer to retrieve.
Analyzer with the given name (see also AnalyzerDef)public void setSearchFactory(SearchFactoryImplementor boundSearchFactory)
IndexManager
setSearchFactory in interface IndexManagerboundSearchFactory - the existing search factory to which to associate this index manager withpublic void addContainedEntity(Class<?> entity)
addContainedEntity in interface IndexManagerentity - Adds the specified entity type to this index manager, making it responsible for manging this type.public void optimize()
IndexManager
optimize in interface IndexManagerpublic BackendQueueProcessor getBackendQueueProcessor()
public void setIndexWriterConfig(org.apache.lucene.index.IndexWriterConfig writerConfig)
public EntityIndexBinder getIndexBindingForEntity(Class<?> entityType)
public Lock getDirectoryModificationLock()
public DirectoryProvider getDirectoryProvider()
public OptimizerStrategy getOptimizerStrategy()
public LuceneIndexingParameters getIndexingParameters()
public LuceneWorkSerializer getSerializer()
getSerializer in interface IndexManager
protected BackendQueueProcessor createBackend(String indexName,
Properties cfg,
WorkerBuildContext buildContext)
initialize(String, Properties, WorkerBuildContext)
protected DirectoryBasedReaderProvider createIndexReader(String indexName,
Properties cfg,
WorkerBuildContext buildContext)
protected DirectoryProvider createDirectoryProvider(String indexName,
Properties cfg,
WorkerBuildContext buildContext)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||