-->
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 can i verify my index is syncronized ?
PostPosted: Fri Dec 11, 2009 12:11 pm 
Newbie

Joined: Fri Dec 11, 2009 10:44 am
Posts: 3
Hi,

I uses Hibernate-Search to index categories and tags on my webapp. I created an IndexerContextListener which run each time i deploy my webapp to be sure the data are correctly indexed.

But now I have a big problem, my webapp needs more than 5 minutes to startup :-(
I have 2 solutions :
    Delay the indexation (async): hard to implement.
    Index data only if the index is out of sync with the database.

How can i verify my index is syncronized with my database, to avoid re-indexing ?

Cheers,

Julius


Top
 Profile  
 
 Post subject: Re: How can i verify my index is syncronized ?
PostPosted: Fri Dec 11, 2009 1:33 pm 
Hibernate Team
Hibernate Team

Joined: Thu Apr 05, 2007 5:52 am
Posts: 1689
Location: Sweden
Hi,

the first question which comes into my mind is whether there is another application which could change the database (update/modify categories and tags). If not, you don't have to re-index all the time at startup. You create an initial index and then rely on auto-indexing to ensure that database and Lucene index stay in sync. This is the "standard" way of doing things :)

The only reason to re-index at startup would be if the database changes are made by another application (w/ or w/o Hibernate). If so you need a way of figuring out which data needs (re-)indexing. The easiest way I could think of is some sort of update timestamp you could add to your entities. Using this timestamp you could then index only the entities which have a younger date than your last indexing time.

--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.