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

Index alias on another alias does not retain the initial filter #15578

Closed
athanikkal opened this issue Dec 21, 2015 · 1 comment
Closed

Index alias on another alias does not retain the initial filter #15578

athanikkal opened this issue Dec 21, 2015 · 1 comment

Comments

@athanikkal
Copy link

If we create an alias on an index with a filter and then subsequently create another alias on the first alias, the second alias does not retain the original filter.

The steps to reproduce.

// create index
curl -XPOST localhost:9200/test -d '{
    "settings" : {
        "number_of_shards" : 1
    },
    "mappings" : {
        "type1" : {
            "properties" : {
                "field1" : { "type" : "string", "index" : "not_analyzed" }
            }
        }
    }
}'

// create first alias
curl -XPOST 'http://localhost:9200/_aliases' -d '{
    "actions" : [
        {
            "add" : {
                 "index" : "test",
                 "alias" : "alias1",
                 "filter" : { "term" : { "field1" : "kimchy" } }
            }
        }
    ]
}'

// create secons alias
curl -XPOST 'http://localhost:9200/_aliases' -d '{
    "actions" : [
        {
            "add" : {
                 "index" : "alias1",
                 "alias" : "alias2"
            }
        }
    ]
}'

// Retrieve the first alias definition
curl -XGET http://localhost:9200/_alias/alias1?pretty

{
  "test" : {
    "aliases" : {
      "alias1" : {
        "filter" : {
          "term" : {
            "field1" : "kimchy"
          }
        }
      }
    }
  }
}

// Retrieve the second alias definition
curl -XGET http://localhost:9200/_alias/alias2
{
  "test" : {
    "aliases" : {
      "alias2" : { }
    }
  }
}

Please see that there is no filter associated with the second alias.

@javanna
Copy link
Member

javanna commented Dec 22, 2015

I think this is more of a documentation issue, which we already have an issue for: #10106 . Alias to alias is not supported and will just create an alias that points to the indices that the target alias points to at creation time. We should document this better so people are not too surprised when this happens. Closing in favor of #10106 .

@javanna javanna closed this as completed Dec 22, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants