-->
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: Search: Several "representations" of an entity
PostPosted: Mon Sep 08, 2008 1:44 pm 
Newbie

Joined: Mon Nov 06, 2006 6:19 pm
Posts: 16
Hello,

I have an entity, which can have several "names". I'd like to index those names, however in my search results obtain each instance of the entity only once (so if the names of entity A are "name1" and "name2", and my query is "name*", I want to get A only once). Any ideas how should I implement such mapping?

--
Regards,
Adam Warski


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 11, 2008 5:02 am 
Hibernate Team
Hibernate Team

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

what do you mean with the entity can have several names? Does it contains a name instance member? Or two?

Generally, you will always only get a single instance once in the result set even if the query matches on multiple fields. How and how often a query matches a single entity will influence the score (position) of the entity in the result set, but not how often it appears. But, that all depends really on what you mean :)

--Hardy


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 11, 2008 5:48 am 
Newbie

Joined: Mon Nov 06, 2006 6:19 pm
Posts: 16
Hello,

in fact it contains a Set<String> of "names"..
I tried mapping it with @IndexEmbedded and it worked to my surprise - from the manual I understood that it can only be used on the not-collection-valued side of a relation. But I was obviously wrong :).

Thanks,
Adam


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:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.