diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/action/get/MultiGetRequest.java b/modules/elasticsearch/src/main/java/org/elasticsearch/action/get/MultiGetRequest.java index 9706fa37380..f6263e6a40f 100644 --- a/modules/elasticsearch/src/main/java/org/elasticsearch/action/get/MultiGetRequest.java +++ b/modules/elasticsearch/src/main/java/org/elasticsearch/action/get/MultiGetRequest.java @@ -67,6 +67,11 @@ public class MultiGetRequest implements ActionRequest { return this.index; } + public Item index(String index) { + this.index = index; + return this; + } + public String type() { return this.type; } diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/action/get/TransportMultiGetAction.java b/modules/elasticsearch/src/main/java/org/elasticsearch/action/get/TransportMultiGetAction.java index 9571a26715a..3ef21ca6216 100644 --- a/modules/elasticsearch/src/main/java/org/elasticsearch/action/get/TransportMultiGetAction.java +++ b/modules/elasticsearch/src/main/java/org/elasticsearch/action/get/TransportMultiGetAction.java @@ -56,6 +56,7 @@ public class TransportMultiGetAction extends BaseAction shardRequests = new HashMap(); for (int i = 0; i < request.items.size(); i++) { MultiGetRequest.Item item = request.items.get(i); + item.index(clusterState.metaData().concreteIndex(item.index())); ShardId shardId = clusterService.operationRouting() .getShards(clusterState, item.index(), item.type(), item.id(), item.routing(), null).shardId(); MultiGetShardRequest shardRequest = shardRequests.get(shardId);