Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multi-Index pattern exclusions do not work on aliases #33395

Closed
costin opened this issue Sep 4, 2018 · 2 comments
Closed

Multi-Index pattern exclusions do not work on aliases #33395

costin opened this issue Sep 4, 2018 · 2 comments
Assignees
Labels
>bug :Data Management/Indices APIs APIs to create and manage indices and templates help wanted adoptme

Comments

@costin
Copy link
Member

costin commented Sep 4, 2018

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.

@costin costin added discuss :Data Management/Indices APIs APIs to create and manage indices and templates labels Sep 4, 2018
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra

@costin
Copy link
Member Author

costin commented Sep 4, 2018

Had a remote debugging session with @talevy and talked with @colings86 over Slack.

@colings86 colings86 added >bug help wanted adoptme and removed discuss labels Sep 7, 2018
@original-brownbear original-brownbear self-assigned this Sep 7, 2018
original-brownbear added a commit to original-brownbear/elasticsearch that referenced this issue Sep 7, 2018
* Adds the pattern exclusion logic to finding aliases
* Closes elastic#33395
original-brownbear added a commit that referenced this issue Sep 9, 2018
* CORE: Make Pattern Exclusion Work with Aliases

* Adds the pattern exclusion logic to finding aliases
* Closes #33395
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>bug :Data Management/Indices APIs APIs to create and manage indices and templates help wanted adoptme
Projects
None yet
Development

No branches or pull requests

4 participants