elasticsearch/elasticsearch — pull request #8380 by jpountz (2014-11-07 08:47:41+00:00)
Title: Internal: Inverse DocIdSets' heuristic to find out fast DocIdSets.

DocIdSets.isFast(DocIdSet) has two issues:
- it works on the DocIdSet interface while some doc sets can generate either
slow or fast iterators depending on their options (eg. whether an OrDocIdSet is
fast or not depends on the wrapped clauses).
- it only works because the result of this method is only taken into account
when a DocIdSet has non-null `bits()`.

Here is a proposal to change this method to work on top of a DocIdSetIterator
and to use a black-list rather than a white list: slow iterators should
really be the exception rather than the rule.