-->
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.  [ 5 posts ] 
Author Message
 Post subject: how to enable automatic indexing when using a custom bridge
PostPosted: Tue Apr 12, 2011 1:56 am 
Newbie

Joined: Wed Mar 09, 2011 11:52 am
Posts: 7
it seems that when using custom bridge,the index generated by custom bridge cannot be updated automatically.for example,i have defined a custom bridge which is used for translating the entity's properties' values into my country's language,so that i can also search that in my language.But if the values in the database change,how can i make sure those values will also be translated without reindexing the whole.


Top
 Profile  
 
 Post subject: Re: how to enable automatic indexing when using a custom bridge
PostPosted: Tue Apr 12, 2011 4:43 am 
Hibernate Team
Hibernate Team

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

it depends on how the values in the database change. If they change as part of the Hibernate Search enabled application then the indexes will automatically updated (or at least they can be). If the database changes via an external process there is not much you can do than re-indexing. This has nothing to do w/ custom bridges. It's a general problem. How would your Hibernate Search application know that the database has changed?
I think you have to options:

  • If the database is changed via a separate process, schedule a re-index at regular intervals (or maybe even trigger based). Depending on your domain model you maybe don't have to re-index everything, but just modified entities. Of course you need a way (query) to select just these changed entities.
  • The alternative is to make changes to the translation tables via the application itself and rely on automatic index updates

--Hardy


Top
 Profile  
 
 Post subject: Re: how to enable automatic indexing when using a custom bridge
PostPosted: Tue Apr 12, 2011 12:29 pm 
Newbie

Joined: Wed Mar 09, 2011 11:52 am
Posts: 7
my custom bridge's function is translating the entity's properties' values and create new document fields with the translated content.so hardy,do you mean that as long as the db is changed through the hibernate itself(not by external ways,like changing the db through mysql command line),my custom bridge will be called every time the changes happen?Thank you~


Top
 Profile  
 
 Post subject: Re: how to enable automatic indexing when using a custom bridge
PostPosted: Tue Apr 12, 2011 2:50 pm 
Hibernate Team
Hibernate Team

Joined: Thu Apr 05, 2007 5:52 am
Posts: 1689
Location: Sweden
What I mean is that if the the db changes are driven via the Hibernate Search enabled application you should be fine. But of course it is hard to say more w/o more information and the annotated domain model?
Read the docs and prototype it. It should not be too hard.

--hardy


Top
 Profile  
 
 Post subject: Re: how to enable automatic indexing when using a custom bridge
PostPosted: Wed Apr 13, 2011 12:30 pm 
Newbie

Joined: Wed Mar 09, 2011 11:52 am
Posts: 7
Thank you indeed hardy.I think maybe i should do some test to verify that.:)


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