Package org.apache.lucene.search

Examples of org.apache.lucene.search.Scorer.docID()


      @Override
      public int advance(final int target) throws IOException {
        scorer.advance(target);
        if (scorer.docID() == DocIdSetIterator.NO_MORE_DOCS
            || (scorer.docID() >= 0 && predicate.get(scorer.docID()))) {
          return scorer.docID();
        }
        return nextDoc();
      }

      @Override
View Full Code Here


        return nextDoc();
      }

      @Override
      public int docID() {
        return scorer.docID();
      }

      @Override
      public float score() throws IOException {
        return scorer.score();
View Full Code Here

      };

    Scorer spanScorer = snq.weight(searcher).scorer(searcher.getIndexReader(), true, false);

    assertTrue("first doc", spanScorer.nextDoc() != DocIdSetIterator.NO_MORE_DOCS);
    assertEquals("first doc number", spanScorer.docID(), 11);
    float score = spanScorer.score();
    assertTrue("first doc score should be zero, " + score, score == 0.0f);
    assertTrue("no second doc", spanScorer.nextDoc() == DocIdSetIterator.NO_MORE_DOCS);
  }
View Full Code Here

    };

    Scorer spanScorer = snq.weight(searcher).scorer(searcher.getIndexReader(), true, false);

    assertTrue("first doc", spanScorer.nextDoc() != DocIdSetIterator.NO_MORE_DOCS);
    assertEquals("first doc number", spanScorer.docID(), 11);
    float score = spanScorer.score();
    assertTrue("first doc score should be zero, " + score, score == 0.0f);
    assertTrue("no second doc", spanScorer.nextDoc() == DocIdSetIterator.NO_MORE_DOCS);
  }
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.