luceneQuery = SpatialQueryBuilderFromCoordinates.buildSpatialQueryByHash( center, radius, "location" );
hibQuery = fullTextSession.createFullTextQuery( luceneQuery, POI.class );
hibQuery.setProjection( "id", "name", "type" );
FacetManager facetManager = hibQuery.getFacetManager();
QueryBuilder queryBuilder = fullTextSession.getSearchFactory().buildQueryBuilder().forEntity( POI.class ).get();
FacetingRequest facetingRequest = queryBuilder.facet()
.name( "typeFacet" )
.onField( "type" )
.discrete()
.orderedBy( FacetSortOrder.COUNT_DESC )
.includeZeroCounts( false )
.createFacetingRequest();
facetManager.enableFaceting( facetingRequest );
Integer size = hibQuery.getResultSize();
List list = hibQuery.list();
List<Facet> facets = facetManager.getFacets( "typeFacet" );
System.out.println( facets );
session.getTransaction().commit();
session.close();