-->
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.  [ 6 posts ] 
Author Message
 Post subject: Hibernate Search - With Views & tables Luce Index sync
PostPosted: Tue May 19, 2009 5:04 am 
Newbie

Joined: Tue May 19, 2009 4:49 am
Posts: 14
Hii ,

I m using Hibernate Search in my application.
It has database view V which have fields from many tables T1, T2 etc. I have Luce indexed view V and other tables T1, T2 ...
Now if the user updates table T1 via my application , is there some way to make updates Lucene Index of view V , as the view V contains columns from these tables.


Top
 Profile  
 
 Post subject: Re: Hibernate Search - With Views & tables Luce Index sync
PostPosted: Tue May 19, 2009 5:10 am 
Hibernate Team
Hibernate Team

Joined: Thu Apr 05, 2007 5:52 am
Posts: 1689
Location: Sweden
Sorry, but I don't understand what your usecase/question is. Maybe you can refine your question and post some of your code?

--Hardy


Top
 Profile  
 
 Post subject: Re: Hibernate Search - With Views & tables Luce Index sync
PostPosted: Tue May 19, 2009 5:29 am 
Newbie

Joined: Tue May 19, 2009 4:49 am
Posts: 14
Yep .. will detail it down .

I have a database View V .. which is create dusing tables T1,T2 etc.
My application will use Hibernate Search - So I have indexed all these for faster search. So I have seprate Lucene Indexed files/folders for each of these i.e V,T1,T2

In the applcaiton the view V is used to display the data . And there are certain transaction which directly update the tables T1,T2 . When the tables are updated via Hibernate core corresponding update occurs in Lucene index entry for particular rows. But Now there is data mistmatch (sync) issue between the lucene index View V data & table T1 data.
Lucene Index files for View V have older data. And displays the same.

Is there any way out to keep the view indexes & table indexed in syncronization.


I hope its clear now. TIA.


Top
 Profile  
 
 Post subject: Re: Hibernate Search - With Views & tables Luce Index sync
PostPosted: Tue May 19, 2009 7:34 am 
Hibernate Team
Hibernate Team

Joined: Thu Apr 05, 2007 5:52 am
Posts: 1689
Location: Sweden
Quote:
And there are certain transaction which directly update the tables T1,T2 .

Well, if this means you are actually bypassing Hibernate and executing some native SQL to modify the data in the tables you are out of luck. What I mean is that you will have to manually sync the indexes. How would Hibernate resp. Hibernate Search know that the data has changed if you bypass the whole framework. Are this table modifications made by a separate client or is it the same application? If so, why can you not work with Hibernate all the time?

--Hardy


Top
 Profile  
 
 Post subject: Re: Hibernate Search - With Views & tables Luce Index sync
PostPosted: Tue May 19, 2009 8:41 am 
Newbie

Joined: Tue May 19, 2009 4:49 am
Posts: 14
The tables are getting updated by the same applicationm and with the use of Hibernate Core API's.
Correct my understanding , if wrong :

As I have two seprate DataObjects , mapped to two different entities (One mapped to table & other to the View) . When I update the table using hibernate , the entries Lucene entries ONLY for the table will be updated.
Although the View have columns from the table, but as its data object is different, and so is its Lucene directory different . Hence columns which come from table , to the view will not be updated in Lucene Directory. Although Data in databse will reflect correct.


Top
 Profile  
 
 Post subject: Re: Hibernate Search - With Views & tables Luce Index sync
PostPosted: Tue May 19, 2009 10:44 am 
Hibernate Team
Hibernate Team

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

I think your argumentation is to data/database centric. You should instead think more in terms of object/entities.
So yes, per default there is one Lucene index per indexed Entity. You can index multiple entities into the same Lucene index, but you still will end up with Lucene Documents representing different entities.

The question is really why are you using a view?

--Hardy


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