Package com.browseengine.bobo.api

Examples of com.browseengine.bobo.api.FacetSpec


        sel.addValue("a");
        Properties prop = sel.getSelectionProperties();
        PathFacetHandler.setDepth(prop, 1);
        br.addSelection(sel);
   
    FacetSpec pathSpec=new FacetSpec();
    pathSpec.setMaxCount(3);
   
    pathSpec.setOrderBy(FacetSortSpec.OrderHitsDesc);
    br.setFacetSpec("multipath", pathSpec);
   
    HashMap<String,List<BrowseFacet>> answer=new HashMap<String,List<BrowseFacet>>();
    answer=new HashMap<String,List<BrowseFacet>>();
    answer.put("multipath", Arrays.asList(new BrowseFacet[]{new BrowseFacet("a-b",7),new BrowseFacet("a-c",4),new BrowseFacet("a-e",2)}));
View Full Code Here


        Properties prop = sel.getSelectionProperties();
        PathFacetHandler.setDepth(prop, 1);
        PathFacetHandler.setStrict(prop, true);
        br.addSelection(sel);
   
    FacetSpec pathSpec=new FacetSpec();
    pathSpec.setMaxCount(3);
   
    pathSpec.setOrderBy(FacetSortSpec.OrderHitsDesc);
    br.setFacetSpec("path", pathSpec);
   
    HashMap<String,List<BrowseFacet>> answer=new HashMap<String,List<BrowseFacet>>();
    answer=new HashMap<String,List<BrowseFacet>>();
    answer.put("path", Arrays.asList(new BrowseFacet[]{new BrowseFacet("a-c-d",2),new BrowseFacet("a-e-f",1)}));
    doTest(br,3,answer,null);
   
    pathSpec.setOrderBy(FacetSortSpec.OrderByCustom);
    pathSpec.setCustomComparatorFactory(new ComparatorFactory(){

      public IntComparator newComparator(
          FieldValueAccessor fieldValueAccessor, final int[] counts) {
        return new IntComparator(){
View Full Code Here

        PathFacetHandler.setDepth(prop, 1);
        PathFacetHandler.setStrict(prop, true);
        sel.addValue("toy/lego");
        br.addSelection(sel);
   
    FacetSpec locationOutput=new FacetSpec();
   
    br.setFacetSpec("location", locationOutput);
   
    FacetSpec tagOutput=new FacetSpec();
    tagOutput.setMaxCount(50);
    tagOutput.setOrderBy(FacetSortSpec.OrderHitsDesc);
   
    br.setFacetSpec("tag", tagOutput);
   
    HashMap<String,List<BrowseFacet>> answer=new HashMap<String,List<BrowseFacet>>();
    answer.put("location", Arrays.asList(new BrowseFacet[]{new BrowseFacet("toy/lego/block",3)}));
View Full Code Here

     
      sel=new BrowseSelection("color");
      sel.addValue("red");
      br.addSelection(sel);
     
      FacetSpec charOutput=new FacetSpec();
      charOutput.setMaxCount(50);
      charOutput.setOrderBy(FacetSortSpec.OrderHitsDesc);
     

      br.setFacetSpec("char", charOutput);
      br.addSortField(new SortField("date",SortField.CUSTOM,true));
     
View Full Code Here

     
      BrowseSelection sel=new BrowseSelection("date");
      sel.addValue("[2001/01/01 TO 2005/01/01]");
      br.addSelection(sel);
     
      FacetSpec ospec=new FacetSpec();
      ospec.setExpandSelection(false);
      br.setFacetSpec("color", ospec);
    
      br.addSortField(new SortField("date",SortField.CUSTOM,true));
     
      HashMap<String,List<BrowseFacet>> answer=new HashMap<String,List<BrowseFacet>>();
View Full Code Here

     
      BrowseSelection sel=new BrowseSelection("date");
      sel.addValue("[2005/01/01 TO *]");
      br.addSelection(sel);
     
      FacetSpec ospec=new FacetSpec();
      ospec.setExpandSelection(false);
      br.setFacetSpec("color", ospec);
    
      br.addSortField(new SortField("date",SortField.CUSTOM,true));
     
      HashMap<String,List<BrowseFacet>> answer=new HashMap<String,List<BrowseFacet>>();
View Full Code Here

     
      BrowseSelection sel=new BrowseSelection("date");
      sel.addValue("[* TO 2002/01/01]");
      br.addSelection(sel);
     
      FacetSpec ospec=new FacetSpec();
      ospec.setExpandSelection(false);
      br.setFacetSpec("color", ospec);
    
      br.addSortField(new SortField("date",SortField.CUSTOM,true));
     
      HashMap<String,List<BrowseFacet>> answer=new HashMap<String,List<BrowseFacet>>();
View Full Code Here

      BrowseRequest br=new BrowseRequest();
      br.setCount(10);
      br.setOffset(0);
     
      FacetSpec colorSpec = new FacetSpec();
      colorSpec.setOrderBy(FacetSortSpec.OrderHitsDesc);
      br.setFacetSpec("color", colorSpec);
     

      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)}));
View Full Code Here

       
      BrowseSelection sel=new BrowseSelection("color");
      sel.addValue("red");
      br.addSelection(sel);
       
      FacetSpec ospec=new FacetSpec();
      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)}));
View Full Code Here

     
      BrowseSelection sel=new BrowseSelection("date");
      sel.addValue("[* TO *]");
      br.addSelection(sel);
     
      FacetSpec ospec=new FacetSpec();
      ospec.setExpandSelection(false);
      br.setFacetSpec("color", ospec);
    
      br.addSortField(new SortField("date",SortField.CUSTOM,false));
     
      doTest(br,7,null,new String[]{"1","3","5","2","4","7","6"});
View Full Code Here

TOP

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

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.