Package org.apache.lucene.search

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


      } finally {
        searcher.setSimilarity(oldSim);
      }
      if (i == subIndex) {
        assertTrue("first doc", spanScorer.nextDoc() != DocIdSetIterator.NO_MORE_DOCS);
        assertEquals("first doc number", spanScorer.docID() + ctx.docBase, 11);
        float score = spanScorer.score();
        assertTrue("first doc score should be zero, " + score, score == 0.0f);
      else {
        assertTrue("no second doc", spanScorer.nextDoc() == DocIdSetIterator.NO_MORE_DOCS);
      }
View Full Code Here


      } finally {
        searcher.setSimilarity(oldSim);
      }
      if (i == subIndex) {
        assertTrue("first doc", spanScorer.nextDoc() != DocIdSetIterator.NO_MORE_DOCS);
        assertEquals("first doc number", spanScorer.docID() + ctx.docBase, 11);
        float score = spanScorer.score();
        assertTrue("first doc score should be zero, " + score, score == 0.0f);
      else {
        assertTrue("no second doc", spanScorer.nextDoc() == DocIdSetIterator.NO_MORE_DOCS);
      }
View Full Code Here

      } finally {
        searcher.setSimilarity(oldSim);
      }
      if (i == subIndex) {
        assertTrue("first doc", spanScorer.nextDoc() != DocIdSetIterator.NO_MORE_DOCS);
        assertEquals("first doc number", spanScorer.docID() + ctx.docBase, 11);
        float score = spanScorer.score();
        assertTrue("first doc score should be zero, " + score, score == 0.0f);
      else {
        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

      };

    Scorer spanScorer = searcher.createNormalizedWeight(snq).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

      @Override
      public int nextDoc() throws IOException {
        for (;;) {
          int docId = scorer.nextDoc();
          if (docId == DocIdSetIterator.NO_MORE_DOCS
              || predicate.get(scorer.docID())) {
            return docId;
          }
        }
      }
View Full Code Here

      }

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

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

      @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();
      }
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.