IndexWriterHolder(ErrorHandler errorHandler, DirectoryBasedIndexManager indexManager) {
this.errorHandler = errorHandler;
this.indexName = indexManager.getIndexName();
LuceneIndexingParameters luceneParameters = indexManager.getIndexingParameters();
this.indexParameters = luceneParameters.getIndexParameters();
this.directoryProvider = indexManager.getDirectoryProvider();
luceneParameters.applyToWriter( writerConfig );
Similarity similarity = indexManager.getSimilarity();
if ( similarity != null ) {
writerConfig.setSimilarity( similarity );
}
writerConfig.setOpenMode( OpenMode.APPEND ); //More efficient to open