Package com.browseengine.bobo.api

Examples of com.browseengine.bobo.api.BrowseResult


    assertEquals(facets.get(0).getFacetValueHitCount(), 1);
  }

  public void test5PropertyInLastDocRetrieval() throws Exception {
    BrowseRequest request = createRequest(1, "prop4");
    BrowseResult res = browser.browse(request);
    System.out.println(res);
    assertEquals(res.getNumHits(), 1);
    assertEquals(res.getHits()[0].getDocid(), 5);

    List<BrowseFacet> facets = res.getFacetAccessor(AttributeHandlerName).getFacets();
    assertEquals(facets.size(), 2);
    assertEquals(facets.get(0).getValue(), "prop4=val2");
    assertEquals(facets.get(0).getFacetValueHitCount(), 1);
    assertEquals(facets.get(1).getValue(), "prop4=val3");
    assertEquals(facets.get(1).getFacetValueHitCount(), 1);
View Full Code Here


    assertEquals(facets.get(1).getFacetValueHitCount(), 1);
  }

  public void test6NonExisitngPropertyDocRetrieval() throws Exception {
    BrowseRequest request = createRequest(1, "propMissing");
    BrowseResult res = browser.browse(request);
    assertEquals(res.getNumHits(), 0);
  }
View Full Code Here

    assertEquals(res.getNumHits(), 0);
  }

  public void test7AndProperties() throws Exception {
    BrowseRequest request = createRequest(1, ValueOperation.ValueOperationAnd, "prop1", "prop3");
    BrowseResult res = browser.browse(request);
    System.out.println(res);
    assertEquals(res.getNumHits(), 2);
    assertEquals(res.getHits()[0].getDocid(), 1);
    assertEquals(res.getHits()[1].getDocid(), 2);
    List<BrowseFacet> facets = res.getFacetAccessor(AttributeHandlerName).getFacets();
    assertEquals(facets.size(), 4);
    assertEquals(facets.get(0).getValue(), "prop1=val2");
    assertEquals(facets.get(0).getFacetValueHitCount(), 2);
    assertEquals(facets.get(1).getValue(), "prop3=val1");
    assertEquals(facets.get(1).getFacetValueHitCount(), 1);
View Full Code Here

  public void test9ModifiedNumberOfFacetsPerKey() throws Exception {
    modifiedSetup();
    BrowseRequest request = createRequest(1, ValueOperation.ValueOperationOr);
    request.getFacetSpec(AttributeHandlerName).setOrderBy(FacetSortSpec.OrderHitsDesc);
    BrowseResult res = browser.browse(request);
    System.out.println(res);
    List<BrowseFacet> facets = res.getFacetAccessor(AttributeHandlerName).getFacets();
    assertEquals(facets.size(), 6);
    assertEquals(facets.get(0).getValue(), "prop1=val1");
    assertEquals(facets.get(0).getFacetValueHitCount(), 4);
    assertEquals(facets.get(1).getValue(), "prop2=val1");
    assertEquals(facets.get(1).getFacetValueHitCount(), 4);
View Full Code Here

  }

  public void test8AndPropertiesPlsExclusion() throws Exception {
    BrowseRequest request = createRequest(1, ValueOperation.ValueOperationAnd, "prop1", "prop3");
    request.getSelection(AttributeHandlerName).addNotValue("prop7");
    BrowseResult res = browser.browse(request);
    System.out.println(res);
    assertEquals(res.getNumHits(), 1);
    assertEquals(res.getHits()[0].getDocid(), 2);
    List<BrowseFacet> facets = res.getFacetAccessor(AttributeHandlerName).getFacets();
    assertEquals(facets.size(), 3);
    assertEquals(facets.get(0).getValue(), "prop1=val2");
    assertEquals(facets.get(0).getFacetValueHitCount(), 1);
    assertEquals(facets.get(1).getValue(), "prop3=val2");
    assertEquals(facets.get(1).getFacetValueHitCount(), 1);
View Full Code Here

    modifiedSetup();
    selectionProperties.put(AttributesFacetHandler.MAX_FACETS_PER_KEY_PROP_NAME, "2");
    BrowseRequest request = createRequest(1, ValueOperation.ValueOperationOr, "prop1", "prop2",
      "prop3", "prop4", "prop5", "prop6", "prop7");
    request.getFacetSpec(AttributeHandlerName).setOrderBy(FacetSortSpec.OrderHitsDesc);
    BrowseResult res = browser.browse(request);
    System.out.println(res);
    List<BrowseFacet> facets = res.getFacetAccessor(AttributeHandlerName).getFacets();
    assertEquals(facets.size(), 9);
    assertEquals(facets.get(0).getValue(), "prop1=val1");
    assertEquals(facets.get(0).getFacetValueHitCount(), 4);
    assertEquals(facets.get(1).getValue(), "prop2=val1");
    assertEquals(facets.get(1).getFacetValueHitCount(), 4);
View Full Code Here

    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());
    BrowseFacet facet = facets.get(0);
    assertEquals(2, facet.getFacetValueHitCount());
View Full Code Here

        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);
    assertEquals("should be doc 0", 0, hits[0].getDocid());
    assertEquals("should be doc 1", 1, hits[1].getDocid());
    assertEquals("should be doc 2", 2, hits[2].getDocid());

    result.close();
  }
View Full Code Here

        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);
    assertEquals("should be doc 0", 0, hits[0].getDocid());
    assertEquals("should be doc 1", 1, hits[1].getDocid());
    assertEquals("should be doc 2", 2, hits[2].getDocid());

    result.close();
  }
View Full Code Here

        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);
    assertEquals("should be doc 0", 0, hits[0].getDocid());
    assertEquals("should be doc 1", 1, hits[1].getDocid());
    assertEquals("should be doc 2", 2, hits[2].getDocid());

    result.close();
  }
View Full Code Here

TOP

Related Classes of com.browseengine.bobo.api.BrowseResult

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.