diff --git a/src/main/java/org/elasticsearch/cluster/metadata/MetaData.java b/src/main/java/org/elasticsearch/cluster/metadata/MetaData.java index b1c89b101e2..5d214f53743 100644 --- a/src/main/java/org/elasticsearch/cluster/metadata/MetaData.java +++ b/src/main/java/org/elasticsearch/cluster/metadata/MetaData.java @@ -191,7 +191,7 @@ public class MetaData implements Iterable { AliasMetaData aliasMd = aliasCursor.value; ImmutableOpenMap.Builder indexAliasMap = (ImmutableOpenMap.Builder) tmpAliases.get(aliasMd.alias()); if (indexAliasMap == null) { - indexAliasMap = ImmutableOpenMap.builder(indices.size()); + indexAliasMap = ImmutableOpenMap.builder(1); // typically, there is 1 alias pointing to an index tmpAliases.put(aliasMd.alias(), indexAliasMap); } indexAliasMap.put(index, aliasMd);