public class DirectoryBasedIndexManager extends Object implements IndexManager
IndexManager is coupled to a
DirectoryProvider and a DirectoryBasedReaderProvider.
This is the base class for all embedded-Lucene index managers.
| Constructor and Description |
|---|
DirectoryBasedIndexManager() |
public String getIndexName()
IndexManagergetIndexName 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 IndexManagerpublic void initialize(String indexName, Properties properties, Similarity similarity, WorkerBuildContext buildContext)
IndexManagerIndexManager before its use.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.properties - the configuration propertiessimilarity - defines the component of Lucene scoringbuildContext - context information needed to initialize this index managerpublic IndexedTypeSet getContainedTypes()
getContainedTypes in interface IndexManagerpublic Similarity getSimilarity()
getSimilarity in interface IndexManagerSimilarity applied to this index. Note, only a single Similarity can be applied to
a given index.public void performStreamOperation(LuceneWork singleOperation, IndexingMonitor monitor, boolean forceAsync)
IndexManagerperformStreamOperation 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 awaitAsyncProcessingCompletion()
IndexManagerIndexManager.performStreamOperation(LuceneWork, IndexingMonitor, boolean) are applied to the index.awaitAsyncProcessingCompletion in interface IndexManagerpublic void performOperations(List<LuceneWork> workList, IndexingMonitor monitor)
IndexManagerperformOperations in interface IndexManagerworkList - the list of write operations to apply.monitor - no be notified of indexing eventspublic 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(org.hibernate.search.engine.integration.impl.ExtendedSearchIntegrator boundSearchIntegrator)
IndexManagerIndexManager to a new ExtendedSearchIntegrator.setSearchFactory in interface IndexManagerboundSearchIntegrator - the existing search factory to which to associate this index manager withpublic void addContainedEntity(IndexedTypeIdentifier entity)
addContainedEntity in interface IndexManagerentity - Adds the specified entity type to this index manager, making it responsible for manging this type.public void optimize()
IndexManageroptimize in interface IndexManagerpublic LuceneWorkSerializer getSerializer()
getSerializer in interface IndexManagerpublic void flushAndReleaseResources()
IndexManagerflushAndReleaseResources in interface IndexManagerpublic org.hibernate.search.backend.impl.lucene.WorkspaceHolder getWorkspaceHolder()
public EntityIndexBinding getIndexBinding(IndexedTypeIdentifier type)
public Lock getDirectoryModificationLock()
public DirectoryProvider<?> getDirectoryProvider()
public OptimizerStrategy getOptimizerStrategy()
public LuceneIndexingParameters getIndexingParameters()
protected org.hibernate.search.backend.impl.lucene.WorkspaceHolder createWorkspaceHolder(String indexName, Properties cfg, WorkerBuildContext buildContext)
protected DirectoryBasedReaderProvider createIndexReader(String indexName, Properties cfg, WorkerBuildContext buildContext)
protected DirectoryProvider<?> createDirectoryProvider(String indexName, Properties cfg, WorkerBuildContext buildContext)
public IndexManagerType getIndexManagerType()
getIndexManagerType in interface IndexManagerIndexManagerType of this implementation.Copyright © 2006-2018 Red Hat, Inc. and others. Licensed under the GNU Lesser General Public License (LGPL), version 2.1 or later.