Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PUT /_aliases should accept a numeric routing value
Also added REST tests for setting index/search/routing via the PUT /_aliases endpoint Fixes #5465
- Loading branch information
1 parent
5faa27d
commit a1d3314
Showing
2 changed files
with
136 additions
and
1 deletion.
There are no files selected for viewing
135 changes: 135 additions & 0 deletions
135
rest-api-spec/test/indices.update_aliases/20_routing.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,135 @@ | ||
setup: | ||
- do: | ||
indices.create: | ||
index: test_index | ||
|
||
--- | ||
"Routing": | ||
|
||
- do: | ||
indices.update_aliases: | ||
body: | ||
actions: | ||
- add: | ||
index: test_index | ||
alias: test_alias | ||
routing: routing | ||
|
||
- do: | ||
indices.get_aliases: | ||
index: test_index | ||
|
||
- match: {test_index.aliases.test_alias: {'index_routing': 'routing', 'search_routing': 'routing'}} | ||
|
||
--- | ||
"Index Routing": | ||
|
||
- do: | ||
indices.update_aliases: | ||
body: | ||
actions: | ||
- add: | ||
index: test_index | ||
alias: test_alias | ||
index_routing: index_routing | ||
|
||
- do: | ||
indices.get_aliases: | ||
index: test_index | ||
|
||
- match: {test_index.aliases.test_alias: {'index_routing': 'index_routing'}} | ||
|
||
--- | ||
"Search Routing": | ||
|
||
- do: | ||
indices.update_aliases: | ||
body: | ||
actions: | ||
- add: | ||
index: test_index | ||
alias: test_alias | ||
search_routing: search_routing | ||
|
||
- do: | ||
indices.get_aliases: | ||
index: test_index | ||
|
||
- match: {test_index.aliases.test_alias: {'search_routing': 'search_routing'}} | ||
|
||
--- | ||
"Index, Default Routing": | ||
|
||
- do: | ||
indices.update_aliases: | ||
body: | ||
actions: | ||
- add: | ||
index: test_index | ||
alias: test_alias | ||
index_routing: index_routing | ||
routing: routing | ||
|
||
- do: | ||
indices.get_aliases: | ||
index: test_index | ||
|
||
- match: {test_index.aliases.test_alias: {'index_routing': 'index_routing', 'search_routing': 'routing'}} | ||
|
||
--- | ||
"Search, Default Routing": | ||
|
||
- do: | ||
indices.update_aliases: | ||
body: | ||
actions: | ||
- add: | ||
index: test_index | ||
alias: test_alias | ||
search_routing: search_routing | ||
routing: routing | ||
|
||
- do: | ||
indices.get_aliases: | ||
index: test_index | ||
|
||
- match: {test_index.aliases.test_alias: {'index_routing': 'routing', 'search_routing': 'search_routing'}} | ||
|
||
--- | ||
"Index, Search, Default Routing": | ||
|
||
- do: | ||
indices.update_aliases: | ||
body: | ||
actions: | ||
- add: | ||
index: test_index | ||
alias: test_alias | ||
index_routing: index_routing | ||
search_routing: search_routing | ||
routing: routing | ||
|
||
- do: | ||
indices.get_aliases: | ||
index: test_index | ||
|
||
- match: {test_index.aliases.test_alias: {'index_routing': 'index_routing', 'search_routing': 'search_routing'}} | ||
|
||
--- | ||
"Numeric Routing": | ||
|
||
- do: | ||
indices.update_aliases: | ||
body: | ||
actions: | ||
- add: | ||
index: test_index | ||
alias: test_alias | ||
routing: 5 | ||
|
||
- do: | ||
indices.get_aliases: | ||
index: test_index | ||
|
||
- match: {test_index.aliases.test_alias: {'index_routing': '5', 'search_routing': '5'}} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters