This class is based on a DocumentHandlerManager instance that can be injected with IoC. So several document handlers for different file types can be registred declaratively or using the registration methods of this class. By default, only the text handler is registred for files with the "txt" extension.
This class is based on the IndexFactory abstraction which is a factory to create IndexWriter for the configured Directory. For the execution and the indexation of the corresponding datas, the indexer uses the same IndexWriter. It calls the IndexWriterFactoryUtils class to eventually release it. So the indexer doesn't need to always hold resources during the indexation of every requests and this avoids some locking problems on the index. You can too apply different strategies for managing index resources.
Can be used within a service implementation via direct instantiation with a IndexFactory reference, or get prepared in an application context and given to services as bean reference. Note: The IndexFactory should always be configured as a bean in the application context, in the first case given to the service directly, in the second case to the prepared template. @author Thierry Templier @see org.springmodules.lucene.index.object.AbstractIndexer @see org.springmodules.lucene.index.factory.IndexFactory @see org.springmodules.lucene.index.support.file.DocumentHandlerManager @see org.springmodules.lucene.index.support.file.ExtensionDocumentHandlerManager @see org.springmodules.lucene.index.support.file.ExtensionDocumentHandlerManagerFactoryBean @see org.springmodules.lucene.index.support.file.DocumentMatching @see org.springmodules.lucene.index.support.file.DocumentHandler @see org.springmodules.lucene.index.object.directory.DocumentIndexingListener @see org.springmodules.lucene.index.factory.IndexWriterFactoryUtils#getIndexWriter(IndexFactory) @see org.springmodules.lucene.index.factory.IndexWriterFactoryUtils#releaseIndexWriter(IndexFactory,IndexWriter)
|
|