Package com.browseengine.bobo.api

Examples of com.browseengine.bobo.api.BrowseFacet


     
      br.setSort(new SortField[]{new SortField("compactnum",SortField.CUSTOM,true)});
     
      HashMap<String,List<BrowseFacet>> answer=new HashMap<String,List<BrowseFacet>>();
      
      answer.put("compactnum", Arrays.asList(new BrowseFacet[]{new BrowseFacet("001",3),new BrowseFacet("002",1),new BrowseFacet("003",3),new BrowseFacet("007",2),new BrowseFacet("008",1),new BrowseFacet("012",1)}));
       
      doTest(br,6,answer,new String[]{"3","7","4","6","1","5"});
     
     
      br=new BrowseRequest();
    br.setCount(10);
      br.setOffset(0);
      sel=new BrowseSelection("compactnum");
      sel.addValue("001");
      sel.addValue("002");
      sel.addValue("003");
      br.addSelection(sel);
      sel.setSelectionOperation(ValueOperation.ValueOperationAnd);
      doTest(br,1,null,new String[]{"6"});
     
      br=new BrowseRequest();
    br.setCount(10);
      br.setOffset(0);
      sel=new BrowseSelection("compactnum");
      sel.addValue("001");
      sel.addValue("003");
      sel.addValue("008");
      sel.setSelectionOperation(ValueOperation.ValueOperationOr);
      br.addSelection(sel);
     
      sel=new BrowseSelection("color");
      sel.addValue("red");
      br.addSelection(sel);
     
      ospec=new FacetSpec();
      br.setFacetSpec("color", ospec);
     
      ospec=new FacetSpec();
      br.setFacetSpec("compactnum",ospec);
      answer=new HashMap<String,List<BrowseFacet>>();
          
          answer.put("compactnum", Arrays.asList(new BrowseFacet[]{new BrowseFacet("001",1),new BrowseFacet("003",2),new BrowseFacet("008",1)}));
          answer.put("color", Arrays.asList(new BrowseFacet[]{new BrowseFacet("red",2)}));
          doTest(br,2,answer,new String[]{"1","7"});
         
      doTest(br,2,answer,new String[]{"1","7"});
  }
View Full Code Here


      FacetSpec ospec=new FacetSpec();
      br.setFacetSpec("multinum", ospec);
      br.setSort(new SortField[]{new SortField("multinum",SortField.CUSTOM,true)});
      HashMap<String,List<BrowseFacet>> answer=new HashMap<String,List<BrowseFacet>>();

    answer.put("multinum", Arrays.asList(new BrowseFacet[]{new BrowseFacet("001",3),new BrowseFacet("002",1),new BrowseFacet("003",3),new BrowseFacet("007",2),new BrowseFacet("008",1),new BrowseFacet("012",1)}));
     
      doTest(br,6,answer,new String[]{"3","4","7","1","6","5"});
     
     
   
    br=new BrowseRequest();
    br.setCount(10);
      br.setOffset(0);
      sel=new BrowseSelection("multinum");
      sel.addValue("001");
      sel.addValue("002");
      sel.addValue("003");
      br.addSelection(sel);
      sel.setSelectionOperation(ValueOperation.ValueOperationAnd);
      doTest(br,1,null,new String[]{"6"});
     
      br=new BrowseRequest();
    br.setCount(10);
      br.setOffset(0);
      sel=new BrowseSelection("multinum");
      sel.addValue("001");
      sel.addValue("003");
      sel.addValue("008");
      sel.setSelectionOperation(ValueOperation.ValueOperationOr);
      br.addSelection(sel);
     
      sel=new BrowseSelection("color");
      sel.addValue("red");
      br.addSelection(sel);
     
      ospec=new FacetSpec();
      br.setFacetSpec("color", ospec);
           
      ospec=new FacetSpec();
      br.setFacetSpec("multinum",ospec);
      answer=new HashMap<String,List<BrowseFacet>>();
      
      answer.put("multinum", Arrays.asList(new BrowseFacet[]{new BrowseFacet("001",1),new BrowseFacet("003",2),new BrowseFacet("008",1)}));
      answer.put("color", Arrays.asList(new BrowseFacet[]{new BrowseFacet("red",2)}));
      doTest(br,2,answer,new String[]{"1","7"});
     
  }
View Full Code Here

   
    FacetSpec simpleOutput=new FacetSpec();
    br.setFacetSpec("shape", simpleOutput);
   
    HashMap<String,List<BrowseFacet>> answer=new HashMap<String,List<BrowseFacet>>();
    answer.put("shape", Arrays.asList(new BrowseFacet[]{new BrowseFacet("circle",2),new BrowseFacet("rectangle",1),new BrowseFacet("square",1)}));

    doTest(br,4,answer,new String[]{"3","4","5","6"});
   
    sel.addNotValue("green");
   
    answer.put("shape", Arrays.asList(new BrowseFacet[]{new BrowseFacet("circle",1),new BrowseFacet("square",1)}));

        doTest(br,2,answer,new String[]{"4","5"});
   
        br=new BrowseRequest();
        br.setCount(10);
View Full Code Here

    FacetSpec simpleOutput=new FacetSpec();
    simpleOutput.setExpandSelection(true);
    br.setFacetSpec("date", simpleOutput);
   
    HashMap<String,List<BrowseFacet>> answer=new HashMap<String,List<BrowseFacet>>();
    answer.put("date",  Arrays.asList(new BrowseFacet[]{new BrowseFacet("[2000/01/01 TO 2003/05/05]", 4), new BrowseFacet("[2003/05/06 TO 2005/04/04]",1)}));
    doTest(br,7,answer,null);
  }
View Full Code Here

    FacetSpec simpleOutput=new FacetSpec();
    simpleOutput.setExpandSelection(true);
    br.setFacetSpec("numendorsers", simpleOutput);
   
    HashMap<String,List<BrowseFacet>> answer=new HashMap<String,List<BrowseFacet>>();
    answer.put("numendorsers",  Arrays.asList(new BrowseFacet[]{new BrowseFacet("[000000 TO 000005]", 2), new BrowseFacet("[000006 TO 000010]",2), new BrowseFacet("[000011 TO 000020]",3)}));
    doTest(br,7,answer,null);
  }
View Full Code Here

    tagOutput.setOrderBy(FacetSortSpec.OrderHitsDesc);
   
    br.setFacetSpec("tag", tagOutput);
   
    HashMap<String,List<BrowseFacet>> answer=new HashMap<String,List<BrowseFacet>>();
    answer.put("color",  Arrays.asList(new BrowseFacet[]{new BrowseFacet("green",1),new BrowseFacet("red",2)}));
    answer.put("size", Arrays.asList(new BrowseFacet[]{new BrowseFacet("[* TO 4]",1),new BrowseFacet("[5 TO 8]",1)}));
    answer.put("shape", Arrays.asList(new BrowseFacet[]{new BrowseFacet("square",2)}));
    answer.put("location", Arrays.asList(new BrowseFacet[]{new BrowseFacet("toy/lego/",1),new BrowseFacet("toy/lego/block",1)}));
    answer.put("tag", Arrays.asList(new BrowseFacet[]{new BrowseFacet("rabbit",2),new BrowseFacet("animal",1),new BrowseFacet("dog",1),new BrowseFacet("humane",1),new BrowseFacet("pet",1)}));
    doTest(br,2,answer,null);
   
  }
View Full Code Here

     
      MultiBoboBrowser multiBoboBrowser = new MultiBoboBrowser(new Browsable[] {boboBrowser, boboBrowser});
      BrowseResult mergedResult = multiBoboBrowser.browse(browseRequest);
     
      HashMap<String,List<BrowseFacet>> answer=new HashMap<String,List<BrowseFacet>>();
      answer.put("color", Arrays.asList(new BrowseFacet[]{new BrowseFacet("red",4),new BrowseFacet("green",2)}));
      answer.put("tag", Arrays.asList(new BrowseFacet[]{new BrowseFacet("animal",2),new BrowseFacet("dog",2),new BrowseFacet("humane",2),new BrowseFacet("pet",2),new BrowseFacet("rabbit",4)}));
      answer.put("shape", Arrays.asList(new BrowseFacet[]{new BrowseFacet("square",4)}));
      answer.put("date",  Arrays.asList(new BrowseFacet[]{new BrowseFacet("[2000/01/01 TO 2003/05/05]", 2)}));
     
      doTest(mergedResult, browseRequest, 4, answer, new String[]{"7","7","1","1"});
     
      browseRequest.setSort(new SortField[]{new SortField("multinum",SortField.CUSTOM,true)});
      mergedResult = multiBoboBrowser.browse(browseRequest);
View Full Code Here

    browser.setFacetHandler(handler);
   
    BrowseRequest req = new BrowseRequest();
    req.setFacetSpec("filtered_date", new FacetSpec());
    HashMap<String,List<BrowseFacet>> answer=new HashMap<String,List<BrowseFacet>>();
      answer.put("filtered_date", Arrays.asList(new BrowseFacet[]{new BrowseFacet("[2001/01/01 TO 2001/12/30]",1),new BrowseFacet("[2007/01/01 TO 2007/12/30]",1)}));
       
    doTest(browser,req,7,answer,null);
  }
View Full Code Here

    numberSpec.setOrderBy(FacetSortSpec.OrderByCustom);
    numberSpec.setMaxCount(3);
    req.setFacetSpec("number", numberSpec);
   
    HashMap<String,List<BrowseFacet>> answer=new HashMap<String,List<BrowseFacet>>();
      answer.put("number", Arrays.asList(new BrowseFacet[]{new BrowseFacet("2130",1),new BrowseFacet("1013",1),new BrowseFacet("0913",1)}));
     
    doTest(req,7,answer,null);
   
    numberSpec.setOrderBy(FacetSortSpec.OrderValueAsc);
    answer.put("number", Arrays.asList(new BrowseFacet[]{new BrowseFacet("0005",1),new BrowseFacet("0010",1),new BrowseFacet("0011",1)}));
     
    doTest(req,7,answer,null);
  }
View Full Code Here

    BrowseRequest req = new BrowseRequest();
    FacetSpec fspec = new FacetSpec();
    req.setFacetSpec("groupby", fspec);
   
    HashMap<String,List<BrowseFacet>> answer=new HashMap<String,List<BrowseFacet>>();
      answer.put("groupby", Arrays.asList(new BrowseFacet[]{new BrowseFacet("red,rectangle,0011",1),new BrowseFacet("red,square,0005",1),new BrowseFacet("red,square,0010",1)}));
     
      BrowseSelection sel=new BrowseSelection("groupby");
      sel.addValue("red");
      req.addSelection(sel);

    doTest(req,3,answer,null);
   
      sel.setValues(new String[]{"red,square"});
      answer.put("groupby", Arrays.asList(new BrowseFacet[]{new BrowseFacet("red,square,0005",1),new BrowseFacet("red,square,0010",1)}));
     
    doTest(req,2,answer,null);
   
    sel.setValues(new String[]{"red,square,0005"});
      answer.put("groupby", Arrays.asList(new BrowseFacet[]{new BrowseFacet("red,square,0005",1)}));
     
    doTest(req,1,answer,null);

    req.removeSelection("groupby");
    fspec.setMaxCount(2);
    answer.put("groupby", Arrays.asList(new BrowseFacet[]{new BrowseFacet("blue,circle,0913",1),new BrowseFacet("blue,square,1013",1)}));
     
    doTest(req,7,answer,null);

  }
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.