elasticsearch/elasticsearch — pull request #7965 by GaelTadh (2014-10-02 17:19:47+00:00)
Title: Term(s) Query/Filter : add _index support

This commit adds support for _index to the term query, terms query, term filter and terms filter.
All of the below queries work as expected :
```
GET /*/_search
{
"query": {
"term": {
"_index": {
"value": "reddit"
}
}}
}

GET /*/_search
{
"query" :
{
"terms": {
"_index": [
"reddit2"
]
}
}
}

GET /*/_search
{
"query":
{
"filtered": {
"query": {
"match_all": {}
},
"filter": {
"terms":
{
"_index": [ "reddit"]
}
}
}
}
}

GET /*/_search
{"query":
{
"filtered": {
"query": {
"match_all": {}
},
"filter": {
"term": { "_index": { "value": "reddit" }}
}
}
} }
```
Since these are evaluated for each index (to resolve mappings) this change simply tests to see if the index is the correct one and returns a MATCH_ALL or MATCH_NO.

Closes #3316