int docStart = start + _docStarts[i];
collector.setNextReader(_subReaders[i], docStart);
validator.setNextReader(_subReaders[i], docStart);
Scorer scorer = weight.scorer(_subReaders[i], true, true);
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
{
target = validator._nextTarget;
target = scorer.advance(target);
}
}
}
if (mapReduceWrapper != null) {
mapReduceWrapper.mapFullIndexReader(_subReaders[i], validator.getCountCollectors());
}
}
return;
}
for (int i = 0; i < _subReaders.length; i++) {
DocIdSet filterDocIdSet = filter.getDocIdSet(_subReaders[i]);
if (filterDocIdSet == null) return; //shall we use return or continue here ??
int docStart = start + _docStarts[i];
collector.setNextReader(_subReaders[i], docStart);
validator.setNextReader(_subReaders[i], docStart);
Scorer scorer = weight.scorer(_subReaders[i], true, false);
if (scorer!=null){
collector.setScorer(scorer);
DocIdSetIterator filterDocIdIterator = filterDocIdSet.iterator(); // CHECKME: use ConjunctionScorer here?
if(filterDocIdIterator == null)
continue;
int doc = -1;
target = filterDocIdIterator.nextDoc();
if (mapReduceWrapper == null) {
while (target < DocIdSetIterator.NO_MORE_DOCS) {
if (doc < target) {
doc = scorer.advance(target);
}
if (doc == target) // permitted by filter
{
if (validator.validate(doc)) {
collector.collect(doc);
target = filterDocIdIterator.nextDoc();
} else {
// skip to the next possible docid
target = filterDocIdIterator.advance(validator._nextTarget);
}
} else // doc > target
{
if (doc == DocIdSetIterator.NO_MORE_DOCS)
break;
target = filterDocIdIterator.advance(doc);
}
}
} else {
//MapReduce wrapper is not null
while (target < DocIdSetIterator.NO_MORE_DOCS) {
if (doc < target) {
doc = scorer.advance(target);
}
if (doc == target) // permitted by filter
{
if (validator.validate(doc)) {