Package com.browseengine.bobo.api

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


        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

    int expectedHitNum = 3;
    try {
      Directory ramIndexDir = createIndex();
      DirectoryReader srcReader = DirectoryReader.open(ramIndexDir);
      boboBrowser = new BoboBrowser(BoboMultiReader.getInstance(srcReader, _facetHandlers));
      result = boboBrowser.browse(br);

      assertEquals(expectedHitNum, result.getNumHits());
    } catch (BrowseException e) {
      e.printStackTrace();
      fail(e.getMessage());
View Full Code Here

    int expectedHitNum = (_documentSize / 2) - 1;
    try {
      Directory ramIndexDir = createIndex();
      DirectoryReader srcReader = DirectoryReader.open(ramIndexDir);
      boboBrowser = new BoboBrowser(BoboMultiReader.getInstance(srcReader, _facetHandlers));
      result = boboBrowser.browse(br);

      assertEquals(expectedHitNum, result.getNumHits());

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

      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

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

      result = boboBrowser.browse(br);
      assertEquals(1, result.getNumHits());
      BrowseHit hit = result.getHits()[0];
      List<SerializableField> storedFields = hit.getStoredFields();
      assertNotNull(storedFields);
View Full Code Here

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

      result = boboBrowser.browse(br);
      assertEquals(1, result.getNumHits());
      BrowseHit hit = result.getHits()[0];
      assertNull(hit.getStoredFields());

      br.setFetchStoredFields(true);
View Full Code Here

      assertEquals(1, result.getNumHits());
      BrowseHit hit = result.getHits()[0];
      assertNull(hit.getStoredFields());

      br.setFetchStoredFields(true);
      result = boboBrowser.browse(br);
      assertEquals(1, result.getNumHits());
      hit = result.getHits()[0];
      String stored = hit.getFieldStringValue("testStored");
      assertTrue("stored".equals(stored));
    } catch (BrowseException e) {
View Full Code Here

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

      result = boboBrowser.browse(br);
      assertEquals(1, result.getNumHits());
      BrowseHit hit = result.getHits()[0];
      assertNull(hit.getStoredFields());

      br.setFetchStoredFields(true);
View Full Code Here

      assertEquals(1, result.getNumHits());
      BrowseHit hit = result.getHits()[0];
      assertNull(hit.getStoredFields());

      br.setFetchStoredFields(true);
      result = boboBrowser.browse(br);
      assertEquals(1, result.getNumHits());
      hit = result.getHits()[0];
      Map<String, List<BoboTerm>> tvMap = hit.getTermVectorMap();
      assertNotNull(tvMap);
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.