Examples of FacetManager


Examples of org.hibernate.search.query.engine.spi.FacetManager

        .from( "S" ).to( "U" )
        .above( "U" ).excludeLimit()
        .orderedBy( FacetSortOrder.RANGE_DEFINITION_ORDER )
        .createFacetingRequest();
    FullTextQuery query = createMatchAllQuery( Cd.class );
    FacetManager facetManager = query.getFacetManager();
    facetManager.enableFaceting( rangeRequest );

    List<Facet> facets = facetManager.getFacets( facetingName );
    assertFacetCounts( facets, new int[] { 7, 1, 2 } );

    facetManager.getFacetGroup( facetingName ).selectFacets( facets.get( 0 ) );
    facets = facetManager.getFacets( facetingName );
    assertFacetCounts( facets, new int[] { 7, 0, 0 } );
  }
View Full Code Here

Examples of org.hibernate.search.query.engine.spi.FacetManager

        .from( formatter.parse( "1990" ) ).to( formatter.parse( "1999" ) )
        .above( formatter.parse( "2000" ) ).excludeLimit()
        .orderedBy( FacetSortOrder.RANGE_DEFINITION_ORDER )
        .createFacetingRequest();
    FullTextQuery query = createMatchAllQuery( Cd.class );
    FacetManager facetManager = query.getFacetManager();
    facetManager.enableFaceting( rangeRequest );

    List<Facet> facets = facetManager.getFacets( facetingName );
    assertFacetCounts( facets, new int[] { 1, 2, 2, 0, 5 } );

    facetManager.getFacetGroup( facetingName ).selectFacets( facets.get( 4 ) );
    facets = facetManager.getFacets( facetingName );
    assertFacetCounts( facets, new int[] { 0, 0, 0, 0, 5 } );
  }
View Full Code Here

Examples of org.hibernate.search.query.engine.spi.FacetManager

      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();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.