SqlDocumentHandler handler = (SqlDocumentHandler)requestDocumentHandlers.get(request);
doHandleRequest(writer, dataSource, request, handler);
}
//Optimize the index
if( optimizeIndex ) {
writer.optimize();
}
} catch(Exception ex) {
ex.printStackTrace();
logger.error("Error during indexing the datasource", ex);
throw new LuceneIndexAccessException("Error during indexing the datasource", ex);