-->
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: Hibernate Search - Query on one to many relationships
PostPosted: Wed Aug 21, 2013 11:11 am 
Newbie

Joined: Wed Aug 21, 2013 10:46 am
Posts: 1
I have a jpa entity class called QueryIndividual which contains 1 or more QueryIdentifier classes in a set.

If I do a query by accessing the database via a org.hibernate.search.jpa.FullTextQuery query class (using JPA) the QueryIndividual properties aswell as all the associated QueryIdentifiers are returned correctly.

However if I set a Projection on the query as follows "firstName","identifiers.idValue" and set a ResultTransformer on the query, I do not get all QueryIdentifiers back. Only one is returned.
('firstName' is the property in the QueryIndividual class, 'identifiers' is a list of QueryIdentifier classes in the QueryIndividual class. 'idValue' is a property in the QueryIdentifier class.)

I understand that the data is denormalized when writing to the lucene engine. It would be fine if I got duplicates in the result set as I can programmatically deal with this.

Example:
if the FirstName property in the QueryIndividual class is set to 'Jimmy' and there are 2 identifiers
'12345' and 'abcde' in the 'identifier' list.

If I search for FirstName='Jimmy'
I would like the resulting hitlist to be (2 records)
'Jimmy','12345'
'Jimmy','abcde'

However I only get
'Jimmy','12345'


Top
 Profile  
 
 Post subject: Re: Hibernate Search - Query on one to many relationships
PostPosted: Mon Sep 02, 2013 10:35 am 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
Hi Garth,
what you're asking is not possible with the current released versions, but we could discuss details for such a feature if you're interested in helping out?

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


Top
 Profile  
 
 Post subject: Re: Hibernate Search - Query on one to many relationships
PostPosted: Fri Sep 06, 2013 7:20 am 
Newbie

Joined: Fri Sep 06, 2013 7:14 am
Posts: 1
I am trying to implement the .setSort() feature on my query. I read that you have to set the field to not be tokenized and that this was changed from Index.UN_TOKENIZED to analyze = Analyze.NO.

_________________
ccie study guide [url=http://www.pass4sure.com/certification/ccie-study-guide.html]ccie study guide[/url]
pmi certification [url=http://www.pass4sure.com/PMI-index.html]pmi certification[/url]
ibm certification [url=http://www.test-king.com/vendor-IBM.htm]ibm certification[/url]
adobe certification [url=http://www.pass4sure.com/Adobe-index.html]adobe certification[/url]
pgmp [url=http://www.pass4sure.com/PgMP.html]pgmp[/url]


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.