public override void SetNextReader(IndexReader reader, int docBase)
{
// confirm that skipping beyond the last doc, on the
// previous reader, hits NO_MORE_DOCS
if (lastReader[0] != null)
{
IndexReader previousReader = lastReader[0];
Weight w = q.Weight(new IndexSearcher(previousReader));
Scorer scorer = w.Scorer(previousReader, true, false);
if (scorer != null)
{
bool more = scorer.Advance(lastDoc[0] + 1) != DocIdSetIterator.NO_MORE_DOCS;
Assert.IsFalse(more, "query's last doc was " + lastDoc[0] + " but skipTo(" + (lastDoc[0] + 1) + ") got to " + scorer.DocID());
}
}
this.reader = lastReader[0] = reader;
lastDoc[0] = -1;
}