I'm trying out the new faceting using Hibernate Search 5.3. It seems to me that @Facet can only be used to match a valid @Field in the same object.
I have a case where an object need to be faceted using a field in an IndexedEmbedded field, but it seems that is not possible. I've tried applying the facet on the embedded entity, but it is ignored.
e.g 1 @Indexed class A{ @Field field c; ... other fields }
@Indexed class B{ @IndexedEmbedded @Facet(forField="a.c") A c; .... other fields }
E.g 2
@Indexed class A{ @Field @Facet field c; ... other fields }
@Indexed class B{ @IndexedEmbedded A a; .... other fields }
In either case, I'm unable to facet B on field c of A. I get an error like the following: org.hibernate.search.exception.SearchException: HSEARCH000268: Facet request 'INDIVIDUAL_ZONES' tries to facet on field 'a.c' which either does not exists or is not configured for faceting (via @Facet). Check your configuration
Please, is there any way this can be achieved?
Thanks!
|