use of org.hibernate.search.MassIndexer in project ice by JBEI.
the class RebuildLuceneIndexTask method execute.
@Override
public void execute() {
Logger.info("Rebuilding lucene index in background");
try {
Session session = HibernateUtil.newSession();
FullTextSession fullTextSession = Search.getFullTextSession(session);
MassIndexer indexer = fullTextSession.createIndexer();
indexer.idFetchSize(20);
indexer.progressMonitor(IndexerProgressMonitor.getInstance());
indexer.startAndWait();
} catch (HibernateException he) {
Logger.error(he);
} catch (InterruptedException e) {
Thread.interrupted();
Logger.warn("Indexing incomplete");
}
}
Aggregations