Package org.apache.lucene.search

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


        validator.setNextReader(_subReaders[i], docStart);

        Scorer scorer = weight.scorer(atomicContext, true, true, _subReaders[i].getLiveDocs());
        if (scorer != null) {
          collector.setScorer(scorer);
          target = scorer.nextDoc();
          while (target != DocIdSetIterator.NO_MORE_DOCS) {
            if (validator.validate(target)) {
              collector.collect(target);
              target = scorer.nextDoc();
            } else {
View Full Code Here


          collector.setScorer(scorer);
          target = scorer.nextDoc();
          while (target != DocIdSetIterator.NO_MORE_DOCS) {
            if (validator.validate(target)) {
              collector.collect(target);
              target = scorer.nextDoc();
            } else {
              target = validator._nextTarget;
              target = scorer.advance(target);
            }
          }
View Full Code Here

      int limit = ((Integer) entry.getValue()).intValue();
      Weight weight = query.weight(searcher);
      Scorer scorer = weight.scorer(reader, true, false);
      if (scorer != null) {
        while(true)  {
          int doc = scorer.nextDoc();
          if (((long) docIDStart) + doc >= limit)
            break;
          reader.deleteDocument(doc);
          any = true;
        }
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

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

  // LUCENE-1404
  private void addDoc(IndexWriter writer, String id, String text) throws IOException {
    final Document doc = new Document();
View Full Code Here

        int limit = ent.limit;
        Weight weight = query.weight(searcher);
        Scorer scorer = weight.scorer(reader, true, false);
        if (scorer != null) {
          while(true)  {
            int doc = scorer.nextDoc();
            if (doc >= limit)
              break;

            reader.deleteDocument(doc);
            // TODO: we could/should change
View Full Code Here

        validator.setNextReader(_subReaders[i], docStart);

        Scorer scorer = weight.scorer(atomicContext, true, true, _subReaders[i].getLiveDocs());
        if (scorer != null) {
          collector.setScorer(scorer);
          target = scorer.nextDoc();
          while (target != DocIdSetIterator.NO_MORE_DOCS) {
            if (validator.validate(target)) {
              collector.collect(target);
              target = scorer.nextDoc();
            } else {
View Full Code Here

          collector.setScorer(scorer);
          target = scorer.nextDoc();
          while (target != DocIdSetIterator.NO_MORE_DOCS) {
            if (validator.validate(target)) {
              collector.collect(target);
              target = scorer.nextDoc();
            } else {
              target = validator._nextTarget;
              target = scorer.advance(target);
            }
          }
View Full Code Here

    return (scorer == null) ? null : new Scorer(similarity, wrapperWeight) {

      @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

      if (childScorer == null) {
        // No matches
        return null;
      }

      final int firstChildDoc = childScorer.nextDoc();
      if (firstChildDoc == DocIdSetIterator.NO_MORE_DOCS) {
        // No matches
        return null;
      }
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.