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'
|