-->
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.  [ 2 posts ] 
Author Message
 Post subject: How to remove old index
PostPosted: Tue Mar 29, 2011 9:18 am 
Newbie

Joined: Tue Mar 29, 2011 9:13 am
Posts: 1
I use Hibernate search for full text search in my web application. I have button for index creation in admin panel. I do it by this code:

fullTextSession.createIndexer()
.purgeAllOnStart(true)
.optimizeAfterPurge(true)
.optimizeOnFinish(true)
.batchSizeToLoadObjects( 25 )
.threadsToLoadObjects( 5 )
.threadsForSubsequentFetching( 20 )
.startAndWait();

If index was build correctly and then I push this button again old index files still on disk and program creates new index. And so on. Can you help me remove old index files before creating new?


Top
 Profile  
 
 Post subject: Re: How to remove old index
PostPosted: Tue Mar 29, 2011 10:03 am 
Hibernate Team
Hibernate Team

Joined: Thu Apr 05, 2007 5:52 am
Posts: 1689
Location: Sweden
What do you mean that a new index gets created? Are there duplicate files? Or duplicate search results? purgeAllOnStart will not physically delete the existing index, but rather first mark the existing documents for deletion and then re-index. On the other hand optimize should be called when the processing is finished.
Maybe you could specify a little more what you mean.

--Hardy


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.