Package com.browseengine.bobo.api

Examples of com.browseengine.bobo.api.FacetSpec


        Object rawGroupValue = null;

        if (_facetAccessibleLists != null) {
          _groupAccessibles = new CombinedFacetAccessible[_facetAccessibleLists.length];
          for (int i = 0; i < _facetAccessibleLists.length; ++i)
            _groupAccessibles[i] = new CombinedFacetAccessible(new FacetSpec(),
                _facetAccessibleLists[i]);
        }
        resList = new ArrayList<MyScoreDoc>(_count);
        Iterator<MyScoreDoc> mergedIter = ListMerger.mergeLists(iterList, MERGE_COMPATATOR);
        Set<Object> groupSet = new HashSet<Object>(_offset + _count);
View Full Code Here


      fillBoboSelections(br, params);
     
      if (params.getBool(FacetParams.FACET, false) && fields!=null){
        // filling facets
        for (String facetField : fields){
          FacetSpec fspec = new FacetSpec();
          br.setFacetSpec(facetField, fspec);
         
          fspec.setMinHitCount(params.getFieldInt(facetField, FacetParams.FACET_MINCOUNT,defaultMinCount));
          fspec.setMaxCount(params.getFieldInt(facetField, FacetParams.FACET_LIMIT,defaultLimit));
          fspec.setExpandSelection(isFacetExpand(params,facetField));
          FacetSpec.FacetSortSpec sortSpec = parseFacetSort(params.getFieldParam(facetField, FacetParams.FACET_SORT,null),defaultFacetSortSpec);
          fspec.setOrderBy(sortSpec);
       
      }
      return br;
  }
View Full Code Here

    req.setFacetSpec("price", spec);
    req.setFacetSpec("mileage", spec);
    req.setFacetSpec("tags", spec);
  }
  public static SenseiRequest getRequest() {
    FacetSpec facetSpecall = new FacetSpec();
    facetSpecall.setMaxCount(1000000);
    facetSpecall.setExpandSelection(true);
    facetSpecall.setMinHitCount(0);
    facetSpecall.setOrderBy(FacetSortSpec.OrderHitsDesc);
    FacetSpec facetSpec = new FacetSpec();
    facetSpec.setMaxCount(5);
    SenseiRequest req = new SenseiRequest();
    req.setCount(3);
    facetSpecall.setMaxCount(3);
    setspec(req, facetSpecall);
    BrowseSelection sel = new BrowseSelection("year");
View Full Code Here

  Map<String, FacetSpec> createFacetSpecMap()
  {
    Map<String, FacetSpec> map = new HashMap<String, FacetSpec>();

    FacetSpec spec = new FacetSpec();
    spec.setExpandSelection(false);
    spec.setMaxCount(10);
    spec.setMinHitCount(2);
    spec.setOrderBy(FacetSpec.FacetSortSpec.OrderHitsDesc);
    map.put("facet1", spec);

    spec = new FacetSpec();
    spec.setExpandSelection(true);
    spec.setMaxCount(5);
    spec.setMinHitCount(10);
    spec.setOrderBy(FacetSpec.FacetSortSpec.OrderValueAsc);
    map.put("facet2", spec);

    for (int i = 3; i < 10; i++) {
      spec = new FacetSpec();
      spec.setExpandSelection(i % 2 == 0);
      spec.setMaxCount(i * 5);
      spec.setMinHitCount(i);
      spec.setOrderBy(i % 2 == 0 ? FacetSpec.FacetSortSpec.OrderValueAsc : FacetSpec.FacetSortSpec.OrderHitsDesc);
      map.put("facet" + i, spec);
    }

/* NOT YET SUPPORTED
    spec = new FacetSpec();
View Full Code Here

  public void test4TotalCountWithFacetSpecLimitMaxFacetsPerKey() throws Exception
  {
    logger.info("executing test case testTotalCountWithFacetSpec");
    SenseiRequest req = new SenseiRequest();
   
    FacetSpec facetSpec = new FacetSpec();
    facetSpec.setMaxCount(20);
    facetSpec.setOrderBy(FacetSortSpec.OrderHitsDesc);
    facetSpec.getProperties().put(AttributesFacetHandler.MAX_FACETS_PER_KEY_PROP_NAME, "1");
    setspec(req, facetSpec);
    req.setCount(5);
    req.setFacetSpec("object_properties", facetSpec);
    //setspec(req, facetSpecall);
    SenseiResult res = broker.browse(req);
View Full Code Here

  public void test5FacetsAll() throws Exception
  {
    logger.info("executing test case testTotalCountWithFacetSpec");
    SenseiRequest req = new SenseiRequest();
   
    FacetSpec facetSpec = new FacetSpec();
    facetSpec.setMaxCount(500);
    facetSpec.setOrderBy(FacetSortSpec.OrderHitsDesc);
    facetSpec.getProperties().put(AttributesFacetHandler.MAX_FACETS_PER_KEY_PROP_NAME, "11");
    setspec(req, facetSpec);
    req.setCount(200);
    req.setFacetSpec("object_properties", facetSpec);
    //setspec(req, facetSpecall);
    SenseiResult res = broker.browse(req);
View Full Code Here

    String field = "groupid";
    req.setCount(4);
   
    req.addSortField(new SortField("groupid", SortField.LONG, false));
    req.addSelection(new BrowseSelection("groupid").addValue("10").addValue("0").addValue("-7000").addValue("-8000").setSelectionOperation(ValueOperation.ValueOperationOr));
    req.setFacetSpec("groupid", new FacetSpec().setMaxCount(50).setMinHitCount(1));
    SenseiResult res = broker.browse(req);
    System.out.println(res);
    long[] groupdIDs = extractFieldValues(field, res);
    assertTrue(Arrays.toString(groupdIDs) + " is not the expected output", Arrays.equals(new long[] {-8000L,  -7000L0L, 10L}, groupdIDs));
  }
View Full Code Here

    assertTrue(Arrays.toString(groupdIDs) + " is not the expected output", Arrays.equals(new long[] {-8000L,  -7000L0L, 10L}, groupdIDs));
  }
 
  public void test4Facets() throws Exception {
    SenseiRequest req = new SenseiRequest();
    FacetSpec fs = new FacetSpec();
    fs.setMinHitCount(1);
    fs.setOrderBy(FacetSortSpec.OrderValueAsc);
    req.setFacetSpec("groupid", fs);
    SenseiResult res = broker.browse(req);
    List<BrowseFacet> facets = res.getFacetAccessor("groupid").getFacets();
    assertEquals("-0000000000000000000000000000000000015000", facets.get(0).getValue());
    assertEquals(1, facets.get(0).getFacetValueHitCount());
View Full Code Here

    sel.addValue(selVal);
    req.addSelection(sel);
   
   
    String field = "groupid_range";
    FacetSpec fs = new FacetSpec();
    fs.setMinHitCount(1);
    fs.setOrderBy(FacetSortSpec.OrderValueAsc);
    req.setFacetSpec(field, fs);
    req.setCount(11);
    req.setOffset(0);
    req.addSortField(new SortField("groupid_range", SortField.LONG, false));
    SenseiResult res = broker.browse(req);
View Full Code Here

    sel.addValue(selVal);
    req.addSelection(sel);
   
   
    String field = "groupid_range";
    FacetSpec fs = new FacetSpec();
    fs.setMinHitCount(1);
    fs.setOrderBy(FacetSortSpec.OrderValueAsc);
    req.setFacetSpec(field, fs);
    req.setCount(11);
    req.setOffset(0);
    req.addSortField(new SortField("groupid_range", SortField.LONG, false));
    SenseiResult res = broker.browse(req);
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.