elasticsearch/elasticsearch — pull request #3997 by dadoonet (2013-10-28 17:04:35+00:00)
Title: PR for mget API should support global routing parameter

mget API support `_routing` field but not `routing` parameter.

Reproduction here:

```sh
curl -XDELETE "http://localhost:9200/test/"; echo
curl -XPUT "http://localhost:9200/test/" -d'{
"settings": {
"number_of_replicas": 0,
"number_of_shards": 5
}
}'; echo

curl -XPUT 'http://localhost:9200/test/order/1-1?routing=key1' -d '{
"productName":"doc 1"
}'; echo
curl -XPUT 'http://localhost:9200/test/order/1-2?routing=key1' -d '{
"productName":"doc 2"
}'; echo
curl -XPUT 'http://localhost:9200/test/order/1-3?routing=key1&refresh=true' -d '{
"productName":"doc 3"
}'; echo

# This works and gives 3 documents
curl -XPOST 'http://localhost:9200/test/order/_mget?pretty' -d '{
"docs" : [
{
"_index" : "test",
"_type" : "order",
"_id" : "1-1",
"_routing" : "key1"
},
{
"_index" : "test",
"_type" : "order",
"_id" : "1-2",
"_routing" : "key1"
},
{
"_index" : "test",
"_type" : "order",
"_id" : "1-3",
"_routing" : "key1"
}
]
}'; echo

# This does not work and returns "exists" : false for each doc
curl -XPOST 'http://localhost:9200/test/order/_mget?pretty&routing=key1' -d '{
"ids": [
"1-1",
"1-2",
"1-3"
]
}'; echo
```

Closes #3996.