Package com.browseengine.bobo.api

Examples of com.browseengine.bobo.api.FacetSpec


      br.addSelection(sel);

      br.setSort(new SortField[] { new SortField("number", SortField.Type.CUSTOM, false) });
      doTest(br, 2, null, new String[] { "7", "1" });

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


    sel.addValue("001");
    sel.addValue("003");
    sel.addValue("007");
    br.addSelection(sel);

    FacetSpec ospec = new FacetSpec();
    br.setFacetSpec("compactnum", ospec);

    br.setSort(new SortField[] { new SortField("compactnum", SortField.Type.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",
View Full Code Here

    br.setOffset(0);
    BrowseSelection sel = new BrowseSelection("multiwithweight");
    sel.addValue("cool");
    br.addSelection(sel);

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

    answer.put("multiwithweight",
View Full Code Here

    sel.addValue("001");
    sel.addValue("003");
    sel.addValue("007");
    br.addSelection(sel);

    FacetSpec ospec = new FacetSpec();
    br.setFacetSpec("multinum", ospec);
    br.setSort(new SortField[] { new SortField("multinum", SortField.Type.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",
View Full Code Here

    BrowseSelection sel = new BrowseSelection("color");
    sel.addNotValue("red");
    br.addSelection(sel);

    FacetSpec simpleOutput = new FacetSpec();
    br.setFacetSpec("shape", simpleOutput);

    HashMap<String, List<BrowseFacet>> answer = new HashMap<String, List<BrowseFacet>>();
    answer.put(
      "shape",
View Full Code Here

  public void testDateRange() {
    BrowseRequest br = new BrowseRequest();
    br.setCount(10);
    br.setOffset(0);

    FacetSpec simpleOutput = new FacetSpec();
    simpleOutput.setExpandSelection(true);
    br.setFacetSpec("date", simpleOutput);

    HashMap<String, List<BrowseFacet>> answer = new HashMap<String, List<BrowseFacet>>();
    answer.put(
      "date",
View Full Code Here

  public void testNewRangeFacet() {
    BrowseRequest br = new BrowseRequest();
    br.setCount(10);
    br.setOffset(0);

    FacetSpec simpleOutput = new FacetSpec();
    simpleOutput.setExpandSelection(true);
    br.setFacetSpec("date", simpleOutput);

    BrowseSelection sel1 = new BrowseSelection("date");
    sel1.setValues(new String[] { "(2000/01/01 TO 2003/02/14]" });
    BrowseSelection sel2 = new BrowseSelection("date");
View Full Code Here

  public void testNumEndorsers() {
    BrowseRequest br = new BrowseRequest();
    br.setCount(10);
    br.setOffset(0);

    FacetSpec simpleOutput = new FacetSpec();
    simpleOutput.setExpandSelection(true);
    br.setFacetSpec("numendorsers", simpleOutput);

    HashMap<String, List<BrowseFacet>> answer = new HashMap<String, List<BrowseFacet>>();
    answer.put(
      "numendorsers",
View Full Code Here

    sel = new BrowseSelection("tag");
    sel.addValue("rabbit");
    br.addSelection(sel);

    FacetSpec output = new FacetSpec();
    output.setMaxCount(5);

    FacetSpec simpleOutput = new FacetSpec();
    simpleOutput.setExpandSelection(true);

    br.setFacetSpec("color", simpleOutput);
    br.setFacetSpec("size", output);
    br.setFacetSpec("shape", simpleOutput);
    br.setFacetSpec("location", output);

    FacetSpec tagOutput = new FacetSpec();
    tagOutput.setMaxCount(5);
    tagOutput.setOrderBy(FacetSortSpec.OrderHitsDesc);

    br.setFacetSpec("tag", tagOutput);

    HashMap<String, List<BrowseFacet>> answer = new HashMap<String, List<BrowseFacet>>();
    answer.put("color",
View Full Code Here

    BrowseSelection tageSel = new BrowseSelection("tag");
    tageSel.addValue("rabbit");
    browseRequest.addSelection(tageSel);

    FacetSpec colorFacetSpec = new FacetSpec();
    colorFacetSpec.setExpandSelection(true);
    colorFacetSpec.setOrderBy(FacetSortSpec.OrderHitsDesc);

    FacetSpec tagFacetSpec = new FacetSpec();

    browseRequest.setFacetSpec("color", colorFacetSpec);
    browseRequest.setFacetSpec("tag", tagFacetSpec);

    FacetSpec shapeSpec = new FacetSpec();
    shapeSpec.setOrderBy(FacetSortSpec.OrderHitsDesc);
    browseRequest.setFacetSpec("shape", shapeSpec);

    FacetSpec dateSpec = new FacetSpec();
    dateSpec.setExpandSelection(true);
    browseRequest.setFacetSpec("date", dateSpec);

    BoboBrowser boboBrowser = newBrowser();

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