DocumentBuilder<Object> builder = searchFactoryImplementor.getDocumentBuilders().get( clazz );
if ( builder == null ) {
throw new IllegalArgumentException( "Entity to index not an @Indexed entity: " + entity.getClass().getName() );
}
Serializable id = session.getIdentifier( entity );
Work work = new Work( entity, id, WorkType.INDEX );
searchFactoryImplementor.getWorker().performWork( work, transactionContext );
//TODO
//need to add elements in a queue kept at the Session level
//the queue will be processed by a Lucene(Auto)FlushEventListener