-->
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: [Hibernate Search] Best practice for *ToMany?
PostPosted: Fri Jun 08, 2007 1:51 pm 
Beginner
Beginner

Joined: Wed Feb 25, 2004 6:23 pm
Posts: 39
I'm curious how others are approaching indexing *ToMany (OneToMany, ManyToMany) relationships in Hibernate Search? Hibernate Search docs say this,

Quote:
@IndexedEmbedded is supported on collections too (ie to index associated object included in collections). But the support is only partially implemented. It will depend on how you update collections (Check HSEARCH-56 in JIRA for more informations). The workaround is to manually index the object (session.index())

So, if I have a @OneToMany on my main entity to a collection of other indexed entities, I should use @IndexedEmbedded? I'm not familiar enough with Lucene, but I know it doesn't have any notion of "join", so how would Hibernate manage a *ToMany using @IndexedEmbedded?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 08, 2007 5:46 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
If we forget about the indexing glitch (HSEARCH-56)
All the elements int he collections are stored in the index, hence a subseque query on the field will do the job
"children.name:Emmanuel" will return the parents having one or several children named Emmanuel

_________________
Emmanuel


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.