elasticsearch/elasticsearch — pull request #4144 by martijnvg (2013-11-10 16:34:37+00:00)
Title: Fixes bug in bool filter where it doesn't emit docs as hits while they are hits

There is an optimization that executes bit based (slow) filters in the end. Matched docs could be unset if they didn't match with any of these filters. The bug was that also iterator based (fast) filters should be checked.
This change checks all should filters in the end part (if must or must_not clauses exists), so it can now correctly unset matched docs. The current bool filters requires that at least one should clause must match for docs to be match regardless of any other clauses.

Relates to #4130