-->
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: Indexing non relational data model and specific use case
PostPosted: Tue Jan 03, 2012 6:41 am 
Expert
Expert

Joined: Tue Dec 28, 2004 7:02 am
Posts: 573
Location: Toulouse, France
Hi all,

After some struggle, I'm now wondering if I shouldn't even not use Hibernate Search for my use case.

Here it is:
* Data to index is a reference database that is almost never modified (say, once a year, and we could provide the corresponding index generated once)
* The tables are not correctly "relational", and so relationships are mostly not mapped (say, only using part of the pk to reference another table in a fk and so on)

My data model is roughly as follows:
/¯\
TreeLevel _ _|
|
*Master*
  /
Note
/
NoteType

And what I'm looking for will always be one or many Master instances, according to some fields located in one of those classes (tables) above.
For the TreeLevel one, it's even a bit more complicated: it's a reflexive structure (as are tree stores most of the time). And I must create the index to be able to type 1.1 (which would be the TreeLevel 1, having a parent TreeLevel called 1).

So my guess is that I only need one type of Lucene Document with many fields. And it might be simpler in my specific case to use only and directly Lucene. Creating the fields I need to be able to query it, and then handle myself loading the only class instances I'll have to load.

What do you think?

Thanks a lot.
PS : please note I'm not saying at all HSearch isn't useful. I'm just wondering if my use case is one where HSearch really adds value.

_________________
Baptiste
PS : please don't forget to give credits below if you found this answer useful :)


Top
 Profile  
 
 Post subject: Re: Indexing non relational data model and specific use case
PostPosted: Tue Jan 03, 2012 6:27 pm 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
Hi,
I don't know the details, but if you specify a custom ClassBridge you are pretty much in control to have it index exactly as you want, with "manual control".

Event listeners triggering re-indexing only trigger when values are changed, so it won't do unneeded operations you until it's needed, and finally you'll still get all the features at query time, like proper pooling of IndexReaders, automatic usage of FieldSelectors and fieldCaches and similar stuff to improve performance of queries.
Of course you could program that all of yourself, but it seems you could still make your work simpler.

I'd say it might be appropriate to not use Hibernate Search if mapping your tables to Hibernate is not making sense, but once that's done I don't see why not. Biased of course but I'm trying to be fair ;-)

_________________
Sanne
http://in.relation.to/


Top
 Profile  
 
 Post subject: Re: Indexing non relational data model and specific use case
PostPosted: Thu Jan 05, 2012 6:57 am 
Expert
Expert

Joined: Tue Dec 28, 2004 7:02 am
Posts: 573
Location: Toulouse, France
Thanks for your answer. I'll try to have a look at ClassBridges.

Cheers

_________________
Baptiste
PS : please don't forget to give credits below if you found this answer useful :)


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.