-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 
Author Message
 Post subject: purging of indexes does not work
PostPosted: Thu Nov 20, 2008 5:53 am 
Newbie

Joined: Wed Nov 12, 2008 5:31 am
Posts: 7
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.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 21, 2008 3:19 am 
Newbie

Joined: Wed Nov 12, 2008 5:31 am
Posts: 7
I have forgotten to say i am using Hibernate Search 3.0.0.GA. Can somebody help me? Any ideas?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 21, 2008 8:30 am 
Newbie

Joined: Wed Nov 12, 2008 5:31 am
Posts: 7
I have solved this problem. I've found this bug report in Jira for the version 3.1.0: http://opensource.atlassian.com/project ... SEARCH-262 . So i would say there is also no possibility to purging subclasses with
Code:
fullTextSession.purgeAll(Class<?>)
in the version 3.0.1. It is a little bit dissapointing that there is no information about it in the official documentation.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Nov 23, 2008 2:51 pm 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
eh you're right, but we can't fix old documentation without a new release...
It's a bug, it wasn't meant to be this way ;-)

_________________
Sanne
http://in.relation.to/


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.