dims[dim].sidewaysCollector = drillSidewaysCollectors[dim];
if (drillDowns[dim] instanceof Filter) {
// Pass null for acceptDocs because we already
// passed it to baseScorer and baseScorer is
// MUST'd here
DocIdSet dis = ((Filter) drillDowns[dim]).getDocIdSet(context, null);
if (dis == null) {
continue;
}
Bits bits = dis.bits();
if (bits != null) {
// TODO: this logic is too naive: the
// existence of bits() in DIS today means
// either "I'm a cheap FixedBitSet so apply me down
// low as you decode the postings" or "I'm so
// horribly expensive so apply me after all
// other Query/Filter clauses pass"
// Filter supports random access; use that to
// prevent .advance() on costly filters:
dims[dim].bits = bits;
// TODO: Filter needs to express its expected
// cost somehow, before pulling the iterator;
// we should use that here to set the order to
// check the filters:
} else {
DocIdSetIterator disi = dis.iterator();
if (disi == null) {
nullCount++;
continue;
}
dims[dim].disi = disi;