Package org.hibernate.search.query.facet

Examples of org.hibernate.search.query.facet.Facet


  private List<Facet> createRangeFacetList(Collection<Entry<String, Integer>> countEntryList, FacetingRequestImpl request, int count) {
    List<Facet> facetList = newArrayList();
    int includedFacetCount = 0;
    for ( Map.Entry<String, Integer> countEntry : countEntryList ) {
      Facet facet = request.createFacet( countEntry.getKey(), countEntry.getValue() );
      if ( !request.hasZeroCountsIncluded() && facet.getCount() == 0 ) {
        continue;
      }
      facetList.add( facet );
      includedFacetCount++;
      if ( includedFacetCount == count ) {
View Full Code Here


  private List<Facet> createRangeFacetList(Collection<Entry<String, Integer>> countEntryList, FacetingRequestImpl request, int count) {
    List<Facet> facetList = newArrayList();
    int includedFacetCount = 0;
    for ( Map.Entry<String, Integer> countEntry : countEntryList ) {
      Facet facet = request.createFacet( countEntry.getKey(), countEntry.getValue() );
      if ( !request.hasZeroCountsIncluded() && facet.getCount() == 0 ) {
        continue;
      }
      facetList.add( facet );
      includedFacetCount++;
      if ( includedFacetCount == count ) {
View Full Code Here

  private List<Facet> createRangeFacetList(Collection<Entry<String, Integer>> countEntryList, FacetingRequestImpl request, int count) {
    List<Facet> facetList = newArrayList();
    int includedFacetCount = 0;
    for ( Map.Entry<String, Integer> countEntry : countEntryList ) {
      Facet facet = request.createFacet( countEntry.getKey(), countEntry.getValue() );
      if ( !request.hasZeroCountsIncluded() && facet.getCount() == 0 ) {
        continue;
      }
      facetList.add( facet );
      includedFacetCount++;
      if ( includedFacetCount == count ) {
View Full Code Here

  }

  private List<Facet> createSortedFacetList(FacetCounter counter, FacetSortOrder sort, boolean includeZeroCounts) {
    List<Facet> facetList = newArrayList();
    for ( Map.Entry<String, Integer> countEntry : counter.getCounts().entrySet() ) {
      Facet facet = new Facet( countEntry.getKey(), countEntry.getValue() );
      if ( !includeZeroCounts && facet.getCount() == 0 ) {
        continue;
      }
      facetList.add( facet );
    }
    Collections.sort( facetList, new FacetComparator( sort ) );
View Full Code Here

  private List<Facet> createRangeFacetList(Collection<Entry<String, IntegerWrapper>> countEntryList, FacetingRequestImpl request, int count) {
    List<Facet> facetList = newArrayList( countEntryList.size() );
    int includedFacetCount = 0;
    for ( Map.Entry<String, IntegerWrapper> countEntry : countEntryList ) {
      Facet facet = request.createFacet( countEntry.getKey(), countEntry.getValue().getCount() );
      if ( !request.hasZeroCountsIncluded() && facet.getCount() == 0 ) {
        continue;
      }
      facetList.add( facet );
      includedFacetCount++;
      if ( includedFacetCount == count ) {
View Full Code Here

  private List<Facet> createRangeFacetList(Collection<Entry<String, IntegerWrapper>> countEntryList, FacetingRequestImpl request, int count) {
    List<Facet> facetList = newArrayList();
    int includedFacetCount = 0;
    for ( Map.Entry<String, IntegerWrapper> countEntry : countEntryList ) {
      Facet facet = request.createFacet( countEntry.getKey(), countEntry.getValue().getCount() );
      if ( !request.hasZeroCountsIncluded() && facet.getCount() == 0 ) {
        continue;
      }
      facetList.add( facet );
      includedFacetCount++;
      if ( includedFacetCount == count ) {
View Full Code Here

    facetManager.enableFaceting( ccsFacetRequest );
    assertEquals( "Wrong number of query matches", 50, query.getResultSize() );
    assertFacetCounts( facetManager.getFacets( colorFacetName ), new int[] { 12, 12, 12, 12, 2 } );
    assertFacetCounts( facetManager.getFacets( ccsFacetName ), new int[] { 17, 16, 16, 1 } );

    Facet colorFacet = facetManager.getFacets( colorFacetName ).get( 0 );
    facetManager.getFacetGroup( colorFacetName ).selectFacets( colorFacet );
    assertFacetCounts( facetManager.getFacets( colorFacetName ), new int[] { 12, 0, 0, 0, 0 } );
    assertFacetCounts( facetManager.getFacets( ccsFacetName ), new int[] { 4, 4, 4, 0 } );

    Facet ccsFacet = facetManager.getFacets( ccsFacetName ).get( 0 );
    facetManager.getFacetGroup( colorFacetName ).selectFacets( colorFacet );
    facetManager.getFacetGroup( ccsFacetName ).selectFacets( ccsFacet );
    assertFacetCounts( facetManager.getFacets( colorFacetName ), new int[] { 4, 0, 0, 0, 0 } );
    assertFacetCounts( facetManager.getFacets( ccsFacetName ), new int[] { 4, 0, 0, 0 } );
View Full Code Here

    }

    public List<Car> selectMenuItem(FacetMenuItem item) {
      // find the right facet using the facet manager
      List<Facet> facets = currentFullTextQuery.getFacetManager().getFacets( item.getFacetingName() );
      Facet facet = facets.get( item.getIndex() );
      selectedFacets.add( facet );

      // rer-run the query
      FullTextSession fullTextSession = Search.getFullTextSession( factory.openSession() );
      buildFullTextQuery( queryString, fullTextSession );
View Full Code Here

    }

    public List<Car> deSelectMenuItem(FacetMenuItem item) {
      // find the right facet using the facet manager
      List<Facet> facets = currentFullTextQuery.getFacetManager().getFacets( item.getFacetingName() );
      Facet facet = facets.get( item.getIndex() );
      selectedFacets.remove( facet );

      // rer-run the query
      FullTextSession fullTextSession = Search.getFullTextSession( factory.openSession() );
      buildFullTextQuery( queryString, fullTextSession );
View Full Code Here

  private List<Facet> createRangeFacetList(Collection<Entry<String, Integer>> countEntryList, FacetingRequestImpl request, int count) {
    List<Facet> facetList = newArrayList();
    int includedFacetCount = 0;
    for ( Map.Entry<String, Integer> countEntry : countEntryList ) {
      Facet facet = request.createFacet( countEntry.getKey(), countEntry.getValue() );
      if ( !request.hasZeroCountsIncluded() && facet.getCount() == 0 ) {
        continue;
      }
      facetList.add( facet );
      includedFacetCount++;
      if ( includedFacetCount == count ) {
View Full Code Here

TOP

Related Classes of org.hibernate.search.query.facet.Facet

Copyright © 2018 www.massapicom. 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.