{
final List<BoboIndexReader> segmentReaders = BoboBrowser.gatherSubReaders(readerList);
if (segmentReaders!=null && segmentReaders.size() > 0) {
final AtomicInteger skipDocs = new AtomicInteger(0);
final SenseiIndexPruner pruner = _core.getIndexPruner();
List<BoboIndexReader> validatedSegmentReaders = _timerMetric.time(new Callable<List<BoboIndexReader>>(){
@Override
public List<BoboIndexReader> call() throws Exception {
IndexReaderSelector readerSelector = pruner.getReaderSelector(request);
List<BoboIndexReader> validatedReaders = new ArrayList<BoboIndexReader>(segmentReaders.size());
for (BoboIndexReader segmentReader : segmentReaders){
if (readerSelector.isSelected(segmentReader)){
validatedReaders.add(segmentReader);
}
else{
skipDocs.addAndGet(segmentReader.numDocs());
}
}
return validatedReaders;
}
});
pruner.sort(validatedSegmentReaders);
browser = new MultiBoboBrowser(BoboBrowser.createBrowsables(validatedSegmentReaders));
request.setSearchable(browser);
request.setQueryBuilderFactory(queryBuilderFactory);
BrowseRequest breq = RequestConverter.convert(request, queryBuilderFactory);