Package com.browseengine.bobo.api

Examples of com.browseengine.bobo.api.BoboBrowser.browse()


    BoboBrowser boboBrowser = null;
    SimpleDateFormat dateFormatter = new SimpleDateFormat("yyyy/MM/dd");
    try {
      boboBrowser = newBrowser();

      result = boboBrowser.browse(br);
      assertEquals(7, result.getNumHits());

      BrowseHit hit = result.getHits()[0];
      assertEquals(0, hit.getDocid());
      Object lowDate = hit.getRawField("date");
View Full Code Here


    BrowseResult result = null;
    BoboBrowser boboBrowser = null;
    try {
      boboBrowser = newBrowser();

      result = boboBrowser.browse(br);

      ByteArrayOutputStream bout = new ByteArrayOutputStream();
      ObjectOutputStream oout = new ObjectOutputStream(bout);
      oout.writeObject(result);
      oout.flush();
View Full Code Here

    br.setOffset(0);
    br.setFacetSpec("number", new FacetSpec());

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

    br.setOffset(0);
    br.setCount(10);
    br.setSort(new SortField[] { SortField.FIELD_SCORE });
    BoboBrowser b = newBrowser();

    BrowseResult r = b.browse(br);

    doTest(r, br, 7, null, new String[] { "7", "2", "1", "3", "4", "5", "6" });
  }

  public void testRuntimeFilteredDateRange() throws Exception {
View Full Code Here

    //
    BrowseRequest req = new BrowseRequest();
    BrowseFacet facet = null;
    FacetSpec facetSpec = new FacetSpec();
    req.setFacetSpec("timerange", facetSpec);
    BrowseResult result = browser.browse(req);
    FacetAccessible facetholder = result.getFacetAccessor("timerange");
    List<BrowseFacet> facets = facetholder.getFacets();
    facet = facets.get(0);
    assertEquals("order by value", "000000001", facet.getValue());
    assertEquals("order by value", 1, facet.getFacetValueHitCount());
View Full Code Here

    req = new BrowseRequest();
    facetSpec = new FacetSpec();
    facetSpec.setMinHitCount(0);
    facetSpec.setOrderBy(FacetSortSpec.OrderHitsDesc);
    req.setFacetSpec("timerange", facetSpec);
    result = browser.browse(req);
    facetholder = result.getFacetAccessor("timerange");
    facets = facetholder.getFacets();
    facet = facets.get(0);
    assertEquals("", "002000000", facet.getValue());
    assertEquals("", 25, facet.getFacetValueHitCount());
View Full Code Here

    BrowseSelection sel = new BrowseSelection("timerange");
    sel.addValue("001000000");
    req.addSelection(sel);
    facetSpec.setExpandSelection(true);
    req.setFacetSpec("timerange", facetSpec);
    result = browser.browse(req);
    facetholder = result.getFacetAccessor("timerange");
    facets = facetholder.getFacets();
    facet = facets.get(0);
    assertEquals("", "000000001", facet.getValue());
    assertEquals("", 1, facet.getFacetValueHitCount());
View Full Code Here

    sel.addValue("003000000");
    sel.addValue("004000000");
    req.addSelection(sel);
    facetSpec.setExpandSelection(false);
    req.setFacetSpec("timerange", facetSpec);
    result = browser.browse(req);
    facetholder = result.getFacetAccessor("timerange");
    facet = facetholder.getFacet("001000000");
    assertEquals("001000000", 20, facet.getFacetValueHitCount());
    facet = facetholder.getFacet("003000000");
    assertEquals("003000000", 3, facet.getFacetValueHitCount());
View Full Code Here

      }
      catch(IOException e)
      {
        throw new BrowseException("failed to create BoboBrowser", e);
      }
      result=browser.browse(req);     
    }       
    return result;
  }

  public void close() throws BrowseException {
View Full Code Here

    req.setFacetSpec("group_id", fspec);
   
    BoboIndexReader reader = BoboIndexReader.getInstance(IndexReader.open(idxDir));
    BoboBrowser browser = new BoboBrowser(reader);
   
    BrowseResult res = browser.browse(req);
   
    Map<String,FacetAccessible> facetMap = res.getFacetMap();
    Collection<FacetAccessible> facetCountCollectors = facetMap.values();
    Iterator<FacetAccessible> iter = facetCountCollectors.iterator();
    while (iter.hasNext())
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.