Examples of browse()


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

    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"});

//      int firstDoc = r.getHits()[0].getDocid();
//      Explanation expl = b.explain(q, firstDoc);
View Full Code Here

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

// 
    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

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

    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

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

    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

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

    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

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

    int expectedHitNum = (_documentSize/2) - 1;
    try {
      Directory ramIndexDir = createIndex();
      IndexReader srcReader=IndexReader.open(ramIndexDir,true);
      boboBrowser = new BoboBrowser(BoboIndexReader.getInstance(srcReader,_facetHandlers, null));
      result = boboBrowser.browse(br);
     
      assertEquals(expectedHitNum,result.getNumHits());

      StringBuilder buffer=new StringBuilder();
      BrowseHit[] hits=result.getHits();
View Full Code Here

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

      BooleanQuery q = new BooleanQuery();
      q.add(NumericRangeQuery.newIntRange("NUM", 10, 10, true, true), Occur.MUST_NOT);
      q.add(new MatchAllDocsQuery(), Occur.MUST);
      br.setQuery(q);
     
      result = boboBrowser.browse(br);
     
      assertEquals(expectedHitNum,result.getNumHits());
      for(int i=0; i<result.getNumHits();i++)
      {
        System.out.println(result.getHits()[i]);
View Full Code Here

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

    int expectedHitNum = 3;
    try {
      Directory ramIndexDir = createIndex();
      IndexReader srcReader=IndexReader.open(ramIndexDir,true);
      boboBrowser = new BoboBrowser(BoboIndexReader.getInstance(srcReader,_facetHandlers, null));
      result = boboBrowser.browse(br);
     
      assertEquals(expectedHitNum,result.getNumHits());
    } catch (BrowseException e) {
      e.printStackTrace();
      fail(e.getMessage());
View Full Code Here

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

    FacetSpec fs = new FacetSpec();
    fs.setMinHitCount(1);
    req.setFacetSpec(PathHandlerName, fs);

    BrowseResult res = browser.browse(req);
    assertEquals(res.getNumHits(), 1);
    FacetAccessible fa = res.getFacetAccessor(PathHandlerName);
    List<BrowseFacet> facets = fa.getFacets();
    System.out.println(facets);
    assertEquals(1, facets.size());
View Full Code Here

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

        Version.LUCENE_43));
    Query q = parser.parse("Foo*");
    br.setQuery(q);

    BoboBrowser browser = new BoboBrowser(boboMultiReader);
    BrowseResult result = browser.browse(br);

    int totalHits = result.getNumHits();
    BrowseHit[] hits = result.getHits();

    assertEquals("should be 3 hits", 3, totalHits);
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.