Skip to content

Usage of faceting in embedded entities in hibernate search 5

Notifications You must be signed in to change notification settings

grommitz/hibernatesearch5-faceting

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Faceting with Hibernate Search 5

Two entities: Parent & Child with a simple one-to-many relationship.

The Child is the @Indexed entity, the Parent is marked as @IndexedEmbedded.

I want to query the children and group by their parents.

Parent.id is marked with @Facet, but when the query runs it gives an error:

org.hibernate.search.exception.SearchException: HSEARCH000268: Facet request 'facetRequest' tries to facet on  field 'parent.id' which either does not exist or is not configured for faceting (via @Facet). Check your configuration.

I would like to know how the @Facet should be set up to make this work, I have not seen any examples of faceting on an embedded entity.

See https://stackoverflow.com/questions/54871971/how-to-use-facet-with-embedded-entities

Database setup (MySQL)

create database facetdb;
create user 'hello'@'localhost';
grant all privileges on facetdb.* to 'hello'@'localhost' identified by 'hello';

About

Usage of faceting in embedded entities in hibernate search 5

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published