Merge pull request #15954 from javanna/enhancement/get_alias_expand_closed

make get alias expand to open and closed indices by default
This commit is contained in:
Luca Cavanna 2016-01-14 14:24:40 +01:00
commit 1cb1607c29
3 changed files with 51 additions and 1 deletions

View File

@ -35,7 +35,7 @@ public class GetAliasesRequest extends MasterNodeReadRequest<GetAliasesRequest>
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;

View File

@ -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+
$/

View File

@ -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