-->
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: Best approach updating Lucene index for custom queries
PostPosted: Tue Sep 13, 2011 9:20 am 
Newbie

Joined: Fri Sep 17, 2010 8:23 am
Posts: 5
I use Hibernate and Hibernate search in my latest project on top of an existing database (MySQL). Once I perform updates through hibernate the Lucene indexes will get automatically updated.

However this database is accessed by other applications as well which don't use hibernate (they access the database directly).

What's the best approach to keep my Lucene indexes up-to date and trigger Lucene updates for every update/delete on the database?
I was planning to use database triggers to detect changes and run a custom 'scheduler' to process (fullTextSession.index(Object)) the found updates (much like this).

Since I didn't found much on this subject and others must have run into the same problem I hope you can give me some advice/recommendations or point me into the right direction.

Thanks in advance


Top
 Profile  
 
 Post subject: Re: Best approach updating Lucene index for custom queries
PostPosted: Fri Sep 16, 2011 7:46 am 
Hibernate Team
Hibernate Team

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

if you have external processes manipulating the database you need indeed some mechanism to then index these changes via the (mass) indexing api. A database trigger seems to be a reasonable approach, in particular if you want to the changes to be available asap.
An other alternative which requires that you have some sort of last modified column in your data is to have a scheduled job regularly checking for database changes and (re-)index the modified data. The best solution depends on how often your data changes and how fast you want the changes to appear in the index.

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