Package org.apache.lucene.search

Examples of org.apache.lucene.search.DocIdSetIterator.advance()


                target = filterDocIdIterator.advance(validator._nextTarget);
              }
            } else // doc > target
            {
              if (doc == DocIdSetIterator.NO_MORE_DOCS) break;
              target = filterDocIdIterator.advance(doc);
            }
          }
          mapReduceWrapper.finalizeSegment(_subReaders[i], validator.getCountCollectors());
        }
      }
View Full Code Here


    // enter main loop:
    while ( true ) {
      final DocIdSetIterator iterator = iterators[i];
      int position = targetPosition;
      if ( !iteratorAlreadyOnTargetPosition( targetPosition, iterator ) ) {
        position = iterator.advance( targetPosition );
      }
      if ( position == DocIdSetIterator.NO_MORE_DOCS ) {
        return result;
      } //exit condition
      if ( position == targetPosition ) {
View Full Code Here

  void doIterate1(BitSet a, FixedBitSet b) throws IOException {
    int aa=-1,bb=-1;
    DocIdSetIterator iterator = b.iterator();
    do {
      aa = a.nextSetBit(aa+1);
      bb = (bb < b.length() && random.nextBoolean()) ? iterator.nextDoc() : iterator.advance(bb + 1);
      assertEquals(aa == -1 ? DocIdSetIterator.NO_MORE_DOCS : aa, bb);
    } while (aa>=0);
  }

  void doIterate2(BitSet a, FixedBitSet b) throws IOException {
View Full Code Here

  void doIterate2(BitSet a, FixedBitSet b) throws IOException {
    int aa=-1,bb=-1;
    DocIdSetIterator iterator = b.iterator();
    do {
      aa = a.nextSetBit(aa+1);
      bb = random.nextBoolean() ? iterator.nextDoc() : iterator.advance(bb + 1);
      assertEquals(aa == -1 ? DocIdSetIterator.NO_MORE_DOCS : aa, bb);
    } while (aa>=0);
  }

  void doRandomSets(int maxSize, int iter, int mode) throws IOException {
View Full Code Here

    mapper = new DocIDMapperImpl(newidArray);
    uidSet = new UIDDocIdSet(newidArray, mapper);
    docidIter = uidSet.iterator();
    intList = new IntArrayList();
    for (int i = 0; i < newidArray.length; ++i) {
      docid = docidIter.advance(i * 10);
      if (docid == DocIdSetIterator.NO_MORE_DOCS) break;
      intList.add(docid);
      docid = docidIter.nextDoc();
      if (docid == DocIdSetIterator.NO_MORE_DOCS) break;
      intList.add(docid);
View Full Code Here

                            matchedQueries.add(name);
                        }
                    } else {
                        DocIdSetIterator iterator = filterDocIdSet.iterator();
                        if (iterator != null) {
                            if (iterator.advance(hitContext.docId()) == hitContext.docId()) {
                                matchedQueries.add(name);
                            }
                        }
                    }
                }
View Full Code Here

            Item top = _heap[0];
            while (true) {
                DocIdSetIterator topIter = top.iter;
                int docid;
                if ((docid = topIter.advance(target)) != DocIdSetIterator.NO_MORE_DOCS) {
                    top.doc = docid;
                    heapAdjust();
                } else {
                    heapRemoveRoot();
                    if (_size == 0) return (_curDoc = DocIdSetIterator.NO_MORE_DOCS);
View Full Code Here

    i = 0;
    votes = 0; //could be smarter but would make the code even more complex for a minor optimization out of cycle.
    // enter main loop:
    while ( true ) {
      final DocIdSetIterator iterator = iterators[i];
      final int position = iterator.advance( targetPosition );
      if ( position==DocIdSetIterator.NO_MORE_DOCS )
        return result; //exit condition
      if ( position == targetPosition ) {
        if ( ++votes == iteratorSize ) {
          result.fastSet( position );
View Full Code Here

    // enter main loop:
    while ( true ) {
      final DocIdSetIterator iterator = iterators[i];
      int position = targetPosition;
      if ( !iteratorAlreadyOnTargetPosition( targetPosition, iterator ) ) {
        position = iterator.advance( targetPosition );
      }
      if ( position == DocIdSetIterator.NO_MORE_DOCS ) {
        return result;
      } //exit condition
      if ( position == targetPosition ) {
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.