public void performWork(LuceneWork work, IndexWriter writer) {
final Class<?> entityType = work.getEntityClass();
@SuppressWarnings("unchecked")
DocumentBuilderIndexedEntity documentBuilder = workspace.getDocumentBuilder( entityType );
Map<String, String> fieldToAnalyzerMap = ( ( AddLuceneWork ) work ).getFieldToAnalyzerMap();
ScopedAnalyzer analyzer = ( ScopedAnalyzer ) documentBuilder.getAnalyzer();
analyzer = updateAnalyzerMappings( analyzer, fieldToAnalyzerMap );
if ( log.isTraceEnabled() ) {
log.trace(
"add to Lucene index: {}#{}:{}",
new Object[] { entityType, work.getId(), work.getDocument() }