BoboMapFunctionWrapper mapReduceWrapper) throws IOException {
final FacetValidator validator = createFacetValidator();
int target = 0;
IndexReader reader = getIndexReader();
IndexReaderContext indexReaderContext = reader.getContext();
if (filter == null) {
for (int i = 0; i < _subReaders.length; i++) {
AtomicReaderContext atomicContext = indexReaderContext.children() == null ? (AtomicReaderContext) indexReaderContext
: (AtomicReaderContext) (indexReaderContext.children().get(i));
int docStart = start;
atomicContext = AtomicReaderContextUtil.updateDocBase(atomicContext, docStart);
if (reader instanceof BoboMultiReader) {
docStart = start + ((BoboMultiReader) reader).subReaderBase(i);
}
collector.setNextReader(atomicContext);
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 {
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++) {
AtomicReaderContext atomicContext = indexReaderContext.children() == null ? (AtomicReaderContext) indexReaderContext
: (AtomicReaderContext) (indexReaderContext.children().get(i));
DocIdSet filterDocIdSet = filter.getDocIdSet(atomicContext, _subReaders[i].getLiveDocs());
if (filterDocIdSet == null) return; // shall we use return or continue here ??
int docStart = start;
if (reader instanceof BoboMultiReader) {