diff --git a/core/src/main/java/org/elasticsearch/action/admin/indices/alias/get/GetAliasesRequest.java b/core/src/main/java/org/elasticsearch/action/admin/indices/alias/get/GetAliasesRequest.java index 182b86fd149..fd3a93b69d9 100644 --- a/core/src/main/java/org/elasticsearch/action/admin/indices/alias/get/GetAliasesRequest.java +++ b/core/src/main/java/org/elasticsearch/action/admin/indices/alias/get/GetAliasesRequest.java @@ -35,7 +35,7 @@ public class GetAliasesRequest extends MasterNodeReadRequest private String[] indices = Strings.EMPTY_ARRAY; private String[] aliases = Strings.EMPTY_ARRAY; - private IndicesOptions indicesOptions = IndicesOptions.strictExpandOpen(); + private IndicesOptions indicesOptions = IndicesOptions.strictExpand(); public GetAliasesRequest(String[] aliases) { this.aliases = aliases; diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/cat.aliases/10_basic.yaml b/rest-api-spec/src/main/resources/rest-api-spec/test/cat.aliases/10_basic.yaml index 3ee33b0a67b..deb1307cec8 100755 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/cat.aliases/10_basic.yaml +++ b/rest-api-spec/src/main/resources/rest-api-spec/test/cat.aliases/10_basic.yaml @@ -188,3 +188,31 @@ index \s+ alias \n test \s+ test_1 \n $/ + +--- +"Alias against closed index": + + - do: + indices.create: + index: test_index + body: + aliases: + test_alias: {} + + - do: + indices.close: + index: test_index + + - do: + cat.aliases: {} + + - match: + $body: | + /^ + test_alias \s+ + test_index \s+ + - \s+ + - \s+ + - \s+ + $/ + diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/indices.get_alias/10_basic.yaml b/rest-api-spec/src/main/resources/rest-api-spec/test/indices.get_alias/10_basic.yaml index 22a67a99144..3cbac46aa59 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/indices.get_alias/10_basic.yaml +++ b/rest-api-spec/src/main/resources/rest-api-spec/test/indices.get_alias/10_basic.yaml @@ -205,3 +205,25 @@ setup: - is_true: test_index - is_true: test_index_2 + +--- +"Get alias against closed indices": + + - do: + indices.close: + index: test_index_2 + + - do: + indices.get_alias: + name: test_alias + + - is_true: test_index + - is_true: test_index_2 + + - do: + indices.get_alias: + name: test_alias + expand_wildcards: open + + - is_true: test_index + - is_false: test_index_2