Hi all,
in my project I have an ecore-model with several classes. I use Teneo to generate the Hibernate-mapping - this works fine. From that mapping I generate the Hibernate Search-mapping using the programmatic API.
A part of the generated mapping:
Code:
.entity([...].PersonImpl.class).indexed()
.property("lastname", ElementType.METHOD).field()
.property("firstname", ElementType.METHOD).field()
.property("dateOfBirth", ElementType.METHOD).field().dateBridge(Resolution.DAY)
.property("title", ElementType.METHOD).field()
.property("participates", ElementType.METHOD).containedIn()
...
.entity([...].OrganisationImpl.class).indexed()
.property("participants", ElementType.METHOD).indexEmbedded()
...
Both entities (Person and Organisation) extend the class InformationObject which has e.g. fields like "name" (which are mapped and indexed too).
The problem: If I try to search for participates.name (or any other reference) with following code:
Code:
QueryBuilder queryBuilder = fullTextSession.getSearchFactory()
.buildQueryBuilder().forEntity(Person.class).get();
org.apache.lucene.search.Query lq = queryBuilder.keyword()
.onFields("participates.name") .ignoreFieldBridge()
.matching(query).createQuery();
org.hibernate.search.FullTextQuery ftq = fullTextSession
.createFullTextQuery(lq, Organisation.class,
Person.class);
I receive an error: Unable to find field participates.name in [...].PersonImpl
Edit: The attribute particpates is of type EList<Organisation> (modifier: protected)I do not know what is wrong with my implementation...
Thanks an advance!