FullTextSession fullTextSession = Search.getFullTextSession( openSession() );
FullTextQuery fullTextQuery = fullTextSession.createFullTextQuery( new MatchAllDocsQuery(), Book.class );
QueryBuilder builder = fullTextSession.getSearchFactory().buildQueryBuilder().forEntity( Book.class ).get();
FacetingRequest facetReq = builder.facet()
.name( "someFacet" )
.onField( "authors.name_untokenized" )
.discrete()
.orderedBy( FacetSortOrder.COUNT_DESC )
.includeZeroCounts( false ).maxFacetCount( 10 )