-
Notifications
You must be signed in to change notification settings - Fork 25.8k
Multi-Index pattern exclusions do not work on aliases #33395
Description
Describe the feature:
Multi-index exclusion should work for aliases not just aliases.
Elasticsearch version (bin/elasticsearch --version): master
Plugins installed: []
JVM version (java -version): Java 10.0.1+10
OS version (uname -a if on a Unix-like system): Win 10
Description of the problem including expected versus actual behavior:
Multi-index allows one to specify an enumeration of indices or aliases, wildcards, inclusions and exclusions when selecting an index.
However it looks like the exclusion, works only for concrete indices and not for aliases.
Steps to reproduce:
assume there are 3 indices, 2 having 2 different aliases pointing to both of them:
PUT test_index1
{
"aliases" : {
"test_alias1" : {},
"test_alias2" : {}
}
}
PUT test_index2
{
"aliases" : {
"test_alias1" : {},
"test_alias2" : {}
}
}
PUT test_index_noalias
{
}
GET /_cat/aliases?v
alias index filter routing.index routing.search
test_alias1 test_index2 - - -
test_alias2 test_index2 - - -
test_alias1 test_index1 - - -
test_alias2 test_index1 - - -The following request:
GetAliasesRequest aliasRequest = new GetAliasesRequest()
.local(true)
.aliases("test_alias1")
.indicesOptions(IndicesOptions.lenientExpandOpen());
Returns test_alias1.
In a similar fashion, using .aliases("test_alias*") returns both test_alias1 and test_alias2 as expected.
However setting .aliases("test_alias*", "-test_alias1") still returns test_alias1 and test_alias2.
The expectation is only test_alias2 is returned.