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

Remove support for GET _aliases #15817

Closed
dadoonet opened this issue Jan 7, 2016 · 5 comments
Closed

Remove support for GET _aliases #15817

dadoonet opened this issue Jan 7, 2016 · 5 comments
Labels
:Data Management/Indices APIs APIs to create and manage indices and templates discuss

Comments

@dadoonet
Copy link
Member

dadoonet commented Jan 7, 2016

GET /{index}/_aliases/{name} is supposed to filter aliases by index and/or by name.

But if you want to filter only by alias name, it gives you back all indices:

curl -XDELETE localhost:9200/foo,bar?pretty
curl -XPUT localhost:9200/foo?pretty
curl -XPUT localhost:9200/bar?pretty
curl -XPOST localhost:9200/_aliases?pretty -d '{
    "actions" : [
        { "add" : { "index" : "foo", "alias" : "myalias" } }
    ]
}'

# Correct
curl -XGET localhost:9200/_aliases?pretty
# {
#   "bar" : {
#     "aliases" : { }
#   },
#   "foo" : {
#     "aliases" : {
#       "myalias" : { }
#     }
#   }
# }

# Correct
curl -XGET localhost:9200/foo/_aliases?pretty
# {
#   "foo" : {
#     "aliases" : {
#       "myalias" : { }
#     }
#   }
# }

# Incorrect
curl -XGET localhost:9200/_aliases/myalias?pretty
# {
#   "bar" : {
#     "aliases" : { }
#   },
#   "foo" : {
#     "aliases" : {
#       "myalias" : { }
#     }
#   }
# }


# Correct
curl -XGET localhost:9200/_alias?pretty
# {
#   "bar" : {
#     "aliases" : { }
#   },
#   "foo" : {
#     "aliases" : {
#       "myalias" : { }
#     }
#   }
# }

# Correct
curl -XGET localhost:9200/foo/_alias?pretty
# {
#   "foo" : {
#     "aliases" : {
#       "myalias" : { }
#     }
#   }
# }

# Correct
curl -XGET localhost:9200/_alias/myalias?pretty
# {
#   "foo" : {
#     "aliases" : {
#       "myalias" : { }
#     }
#   }
# }

We don't document GET _aliases anymore so may be we should remove its support as we can do the same thing with GET _alias API.

Might be related to #4743
Related to elastic/elasticsearch-js#331

@clintongormley
Copy link
Contributor

There used to be a difference between GET _alias and GET _aliases (the details of which escape me) which Kibana depended on, but I think this has been resolved. @rashidkpc could you confirm?

@rashidkpc
Copy link

@spalger you were looking at this the other day. Where did we decide to go with it?

@spalger
Copy link
Contributor

spalger commented Jan 10, 2016

I was looking at this from the perspective of removing it from the client, not sure how it relates to Kibana.

@javanna
Copy link
Member

javanna commented Jan 13, 2016

this appears to be a duplicate of #13906. +1 for removing asap, especially given that filtering aliases by name doesn't work.

@dadoonet
Copy link
Member Author

Thank you @javanna. For whatever reason I did not find this issue. Closing this then.

@clintongormley clintongormley added :Data Management/Indices APIs APIs to create and manage indices and templates and removed :Aliases labels Feb 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Data Management/Indices APIs APIs to create and manage indices and templates discuss
Projects
None yet
Development

No branches or pull requests

5 participants