-->
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.  [ 3 posts ] 
Author Message
 Post subject: Reindexing new records only
PostPosted: Mon Mar 05, 2012 6:28 pm 
Newbie

Joined: Thu Jan 12, 2012 6:28 am
Posts: 12
Hello everybody,

(I search some hours but i don't find a solution for my problem, may be i have not typed the good keywords...)

Let me explain my use case :

I have an application (JEE) connected on a database. This application never add entries in the database because the insert process is managed by an another application.

However i need to maintain an index synchronized with the database. Actually, i reindex every 12 hours. It's bad because i reindex ALL data (1Go) while we just inserted 1 or 2 Mo...

I can write methods to search new entries and then indexing only new but it depends on my indexed tables or it will be hard for me to make a generic method to compare lucene index with database and then automaticly search and reindex new entities...

So my questions are simples :
- Why we don't have a method indexNew()? (in my use case, data are just inserted, modifications are extremely rare).
- Do you see a simple way to solve my use case?

Thank you by advance,

(Sorry for my english, i'm french :))


Top
 Profile  
 
 Post subject: Re: Reindexing new records only
PostPosted: Thu Mar 08, 2012 6:08 am 
Hibernate Team
Hibernate Team

Joined: Thu Apr 05, 2007 5:52 am
Posts: 1689
Location: Sweden
IMO this type of use cases are best solved with a last update timestamp (provided your table/entities have one). Just store your last update timestamp in between index runs and only index entities which are newer.

Even better of course would be if the insertions would be via Hibernate Search as well so that you could just rely on the automatic index synchronization.

--Hardy


Top
 Profile  
 
 Post subject: Re: Reindexing new records only
PostPosted: Fri Mar 09, 2012 4:16 am 
Newbie

Joined: Thu Jan 12, 2012 6:28 am
Posts: 12
Thank you for your answer Hardy,

This is the solution i'm implementing because for the moment i'm not responsible for insertions.


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