Package com.browseengine.bobo.api

Examples of com.browseengine.bobo.api.BrowseFacet


      br.setFacetSpec("char", charOutput);
      br.addSortField(new SortField("date",SortField.CUSTOM,true));
     
      HashMap<String,List<BrowseFacet>> answer=new HashMap<String,List<BrowseFacet>>();
      answer.put("char", Arrays.asList(new BrowseFacet[]{new BrowseFacet("a",1),new BrowseFacet("i",1),new BrowseFacet("k",1)}));
     
      doTest(br,3,answer,new String[]{"7","2","1"});
  }
View Full Code Here


      br.setFacetSpec("color", ospec);
    
      br.addSortField(new SortField("date",SortField.CUSTOM,true));
     
      HashMap<String,List<BrowseFacet>> answer=new HashMap<String,List<BrowseFacet>>();
      answer.put("color", Arrays.asList(new BrowseFacet[]{new BrowseFacet("blue",2),new BrowseFacet("green",1),new BrowseFacet("red",1)}));
      doTest(br,4,answer,new String[]{"4","2","5","3"});
  }
View Full Code Here

      br.setFacetSpec("color", ospec);
    
      br.addSortField(new SortField("date",SortField.CUSTOM,true));
     
      HashMap<String,List<BrowseFacet>> answer=new HashMap<String,List<BrowseFacet>>();
      answer.put("color", Arrays.asList(new BrowseFacet[]{new BrowseFacet("green",1),new BrowseFacet("red",1)}));
      doTest(br,2,answer,new String[]{"6","7"});
    }
View Full Code Here

      br.setFacetSpec("color", ospec);
    
      br.addSortField(new SortField("date",SortField.CUSTOM,true));
     
      HashMap<String,List<BrowseFacet>> answer=new HashMap<String,List<BrowseFacet>>();
      answer.put("color", Arrays.asList(new BrowseFacet[]{new BrowseFacet("green",1),new BrowseFacet("red",1)}));
      doTest(br,2,answer,new String[]{"3","1"});
    }
View Full Code Here

      FacetSpec shapeSpec = new FacetSpec();
      shapeSpec.setOrderBy(FacetSortSpec.OrderValueAsc);
      br.setFacetSpec("shape", shapeSpec);
     
      HashMap<String,List<BrowseFacet>> answer=new HashMap<String,List<BrowseFacet>>();
      answer.put("color", Arrays.asList(new BrowseFacet[]{new BrowseFacet("red",3),new BrowseFacet("blue",2),new BrowseFacet("green",2)}));
      answer.put("shape", Arrays.asList(new BrowseFacet[]{new BrowseFacet("circle",2),new BrowseFacet("rectangle",2),new BrowseFacet("square",3)}));
     
      doTest(br,7,answer,null);
     
      Comparator<BrowseFacet> valComp = new FacetValueComparatorFactory().newComparator();
     
      int v = valComp.compare(new BrowseFacet("red",3), new BrowseFacet("blue",2));
      assertTrue(v>0);
     
      valComp = new FacetHitcountComparatorFactory().newComparator();
      v = valComp.compare(new BrowseFacet("red",3), new BrowseFacet("blue",2));
      assertTrue(v<0);
     
      v = valComp.compare(new BrowseFacet("red",3), new BrowseFacet("blue",3));
      assertTrue(v>0);
  }
View Full Code Here

      ospec.setExpandSelection(false);
      br.setFacetSpec("color", ospec);
      

      HashMap<String,List<BrowseFacet>> answer=new HashMap<String,List<BrowseFacet>>();
      answer.put("color", Arrays.asList(new BrowseFacet[]{new BrowseFacet("red",3)}));
      
      doTest(br,3,null,new String[0]);
  }
View Full Code Here

     

      br.setSort(new SortField[]{new SortField("number",SortField.CUSTOM,false)});
     
      HashMap<String,List<BrowseFacet>> answer=new HashMap<String,List<BrowseFacet>>();
      answer.put("color", Arrays.asList(new BrowseFacet[]{new BrowseFacet("red",3),new BrowseFacet("blue",2)}));
     
      doTest(br,7,answer,new String[]{"7","1","2"});
  }
View Full Code Here

      spec.setMinHitCount(0);
      spec.setOrderBy(FacetSortSpec.OrderHitsDesc);
      br.setFacetSpec("color", spec);
               
      HashMap<String,List<BrowseFacet>> answer=new HashMap<String,List<BrowseFacet>>();
      answer.put("color", Arrays.asList(new BrowseFacet[]{new BrowseFacet("red",2),new BrowseFacet("blue",1),new BrowseFacet("green",0)}));
       
      doTest(br,3,answer,null);
  }
View Full Code Here

     
      BoboBrowser browser = newBrowser();
     
      BrowseResult res=browser.browse(br);
      FacetAccessible facetAccessor = res.getFacetAccessor("number");
      BrowseFacet facet = facetAccessor.getFacet("5");
     
      assertEquals(facet.getValue(), "0005");
      assertEquals(facet.getFacetValueHitCount(), 1);
      res.close();
  }
View Full Code Here

        FacetSpec ospec=new FacetSpec();
        ospec.setExpandSelection(true);
        br.setFacetSpec("color", ospec);
        HashMap<String,List<BrowseFacet>> answer=new HashMap<String,List<BrowseFacet>>();
        answer.put("color", Arrays.asList(new BrowseFacet[]{new BrowseFacet("blue",2),new BrowseFacet("green",1),new BrowseFacet("red",2)}));
        doTest(br,2,answer,new String[]{"7","1"});
       
        br.clearSelections();
        answer.put("color", Arrays.asList(new BrowseFacet[]{new BrowseFacet("blue",2),new BrowseFacet("green",1),new BrowseFacet("red",2)}));
        doTest(br,5,answer,new String[]{"7","1","3","4","5"});
       
    }
    catch(Exception e)
    {
View Full Code Here

TOP

Related Classes of com.browseengine.bobo.api.BrowseFacet

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.