@Override protected Document fetchNextOrNull() { try { int doc = idIterator.nextDoc(); if ( doc == DocIdSetIterator.NO_MORE_DOCS ) { return null; } return getDocument( doc ); } catch ( IOException e ) { throw new LuceneDocumentRetrievalException( "Can't fetch document id from lucene index.", e ); } } };
@Override public int nextDoc() throws IOException { final int subNext = sub.nextDoc(); if (subNext == NO_MORE_DOCS) { return firstDocFromNextBlock(); } return doc = (block << 16) | subNext; }
@Override public int nextDoc() throws IOException { while ((doc = _innerIter.nextDoc()) != NO_MORE_DOCS) { if (match(doc)) { return doc; } } return doc; }
/** Slow (linear) implementation of {@link #advance} relying on * {@link #nextDoc()} to advance beyond the target position. */ protected final int slowAdvance(int target) throws IOException { assert docID() < target; int doc; do { doc = nextDoc(); } while (doc < target); return doc; }
@Override public int nextDoc() throws IOException { int docID = docsWithField.nextDoc(); if (docID != NO_MORE_DOCS) { value = iter.next(); } return docID; }
@Override public int nextDoc() throws IOException { return (conjunction.nextDoc() == NO_MORE_DOCS) ? NO_MORE_DOCS : toMatchDoc(); }
@Override public int nextDoc() throws IOException { int docID = docsWithField.nextDoc(); if (docID != NO_MORE_DOCS) { ord = Math.toIntExact(iter.next()); ord = ordMap[ord]; } return docID; }
@Override public int nextDoc() throws IOException { if (in == null) { in = new BitSetIterator(bits, 0); } return in.nextDoc(); }
private int doNext(int doc) throws IOException { for (;; doc = approximation.nextDoc()) { if (doc == NO_MORE_DOCS) { return NO_MORE_DOCS; } else if (twoPhaseIterator.matches()) { return doc; } } }
@Override public int nextDoc() throws IOException { int docID = docsWithField.nextDoc(); if (docID != NO_MORE_DOCS) { value = iter.next(); } return docID; }
/** Does in-place OR of the bits provided by the iterator. The state of the * iterator after this operation terminates is undefined. */ public void or(DocIdSetIterator iter) throws IOException { checkUnpositioned(iter); for (int doc = iter.nextDoc(); doc != DocIdSetIterator.NO_MORE_DOCS; doc = iter.nextDoc()) { set(doc); } }
@Override public int nextDoc() throws IOException { return doNext(approximation.nextDoc()); }
@Override public int nextDoc() throws IOException { for (int i = valueUpto; i < valueCount; ++i) { valuesIter.next(); } int docID = docsWithField.nextDoc(); if (docID != NO_MORE_DOCS) { valueCount = Math.toIntExact(valueCountsIter.next()); valueUpto = 0; } return docID; }
int toMatchDoc() throws IOException { oneExhaustedInCurrentDoc = false; while (true) { if (twoPhaseCurrentDocMatches()) { return docID(); } if (conjunction.nextDoc() == NO_MORE_DOCS) { return NO_MORE_DOCS; } } }
@Override public int nextDoc() throws IOException { topPositionSpans = null; DisiWrapper topDocSpans = byDocQueue.top(); int currentDoc = topDocSpans.doc; do { topDocSpans.doc = topDocSpans.iterator.nextDoc(); topDocSpans = byDocQueue.updateTop(); } while (topDocSpans.doc == currentDoc); return topDocSpans.doc; }
@Override public int nextDoc() throws IOException { DisiWrapper top = subIterators.top(); final int doc = top.doc; do { top.doc = top.approximation.nextDoc(); top = subIterators.updateTop(); } while (top.doc == doc); return top.doc; }
@Override public int nextDoc() throws IOException { int docID = docsWithField.nextDoc(); if (docID != NO_MORE_DOCS) { int length = Math.toIntExact(lengthsIterator.next()); value.setLength(length); bytesIterator.readBytes(value.bytes(), 0, length); } return docID; }
@Override public boolean keepFullyDeletedSegment(IOSupplier<CodecReader> readerIOSupplier) throws IOException { CodecReader reader = readerIOSupplier.get(); /* we only need a single hit to keep it no need for soft deletes to be checked*/ Scorer scorer = getScorer(retentionQuerySupplier.get(), FilterCodecReader.wrapLiveDocs(reader, null, reader.maxDoc())); if (scorer != null) { DocIdSetIterator iterator = scorer.iterator(); boolean atLeastOneHit = iterator.nextDoc() != DocIdSetIterator.NO_MORE_DOCS; return atLeastOneHit; } return super.keepFullyDeletedSegment(readerIOSupplier) ; }
private void replayTo( Collector collector ) throws IOException { for ( MatchingDocs docs : getMatchingDocs() ) { LeafCollector leafCollector = collector.getLeafCollector( docs.context ); Scorer scorer; DocIdSetIterator idIterator = docs.docIdSet.iterator(); if ( isKeepScores() ) { scorer = new ReplayingScorer( docs.scores ); } else { scorer = new ConstantScoreScorer( null, Float.NaN, idIterator ); } leafCollector.setScorer( scorer ); int doc; while ( (doc = idIterator.nextDoc()) != DocIdSetIterator.NO_MORE_DOCS ) { leafCollector.collect( doc ); } } }