From bc6d9c19e838747329eb31944b7e63c2ea1ba142 Mon Sep 17 00:00:00 2001 From: Igor Motov Date: Wed, 11 May 2011 16:56:07 -0400 Subject: [PATCH] Fix double counts when count is executed on two aliases pointing to the same index --- .../main/java/org/elasticsearch/cluster/metadata/MetaData.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/cluster/metadata/MetaData.java b/modules/elasticsearch/src/main/java/org/elasticsearch/cluster/metadata/MetaData.java index 631717adec0..6f58b1a002f 100644 --- a/modules/elasticsearch/src/main/java/org/elasticsearch/cluster/metadata/MetaData.java +++ b/modules/elasticsearch/src/main/java/org/elasticsearch/cluster/metadata/MetaData.java @@ -177,13 +177,14 @@ public class MetaData implements Iterable { for (String index : indices) { if (!this.indices.containsKey(index)) { possiblyAliased = true; + break; } } if (!possiblyAliased) { return indices; } - ArrayList actualIndices = Lists.newArrayListWithCapacity(indices.length); + Set actualIndices = Sets.newHashSetWithExpectedSize(indices.length); for (String index : indices) { String[] actualLst = aliasAndIndexToIndexMap.get(index); if (actualLst == null) {