return writer;
try {
writer = new IndexWriter( directoryProvider.getDirectory(), SIMPLE_ANALYZER, false, maxFieldLength ); // has been created at init time
indexingParams.applyToWriter( writer, batchmode );
writer.setSimilarity( similarity );
MergeScheduler mergeScheduler = new ConcurrentMergeScheduler( this.errorHandler );
writer.setMergeScheduler( mergeScheduler );
log.trace( "IndexWriter opened" );
}
catch ( IOException ioe ) {
writer = null;