elasticsearch/elasticsearch — pull request #3676 by jgautier (2013-09-12 16:50:45+00:00)
Title: term lookup query with no results should evaluate to no match

When a term lookup query returns no results it is considered a no filter rather than a no match which causes other filters to ignore the results.

For example:

```js
{
"query": {
"filtered": {
"filter": {
"and": [
{
"term": {
"name": "value1"
}
},
{
"terms": {
"_id": {
"index": "users",
"type": "user",
"id": "2",
"path": "followers"
}
}
}
]
}
}
}
}
```

In this case if the terms lookup returned no results it would ignore the terms lookup filter altogether when it should return no results because of the overall evaluation of the and should be false.