massIndexer.purgeAllOnStart(true);
try {
if (!async) {
massIndexer.startAndWait();
} else {
massIndexer.start();
}
} catch (InterruptedException e) {
log.error("mass reindexing interrupted: " + e.getMessage());
} finally {
txtentityManager.flushToIndexes();