Hi,
i am trying to use hibernate search in my application. Indexing and manual indexing seem to work now. The only thing does not work is manual purging of the indexes. But if I delete objects with hibernate the indexes are also going to be deleted.
Here is my code:
Code:
public void removeAllIndexes()
{
FullTextSession fullTextSession = Search.createFullTextSession(getSession());
fullTextSession.purgeAll(MasterData.class);
fullTextSession.getSearchFactory().optimize(MasterData.class);
fullTextSession.flush(); // apply changes to indexes
fullTextSession.clear(); // clear since the queue is processed
}
This code is executed in spring hibernate template inside its callback method:
Code:
tt.execute(new TransactionCallbackWithoutResult()
{
@Override
protected void doInTransactionWithoutResult(TransactionStatus status)
{
service.removeAllIndexes();
}
});
I don't know if there is an inheritance problem. The objects i am trying to purge are sublasses of MasterData.class.
Has anybody an idea? What am i missing here? Thanks in advance.