From 8f6de29580f0162b897525445cfd47cd81bb0d4f Mon Sep 17 00:00:00 2001 From: kimchy Date: Tue, 19 Jul 2011 19:58:25 +0300 Subject: [PATCH] mget doesn't work with aliases. closes #1130. --- .../java/org/elasticsearch/action/get/MultiGetRequest.java | 5 +++++ .../elasticsearch/action/get/TransportMultiGetAction.java | 1 + 2 files changed, 6 insertions(+) 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);