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

Retrieve aliases api doesn't always include 'aliases' section #9148

Closed
grantr opened this issue Jan 5, 2015 · 3 comments · Fixed by #9178
Closed

Retrieve aliases api doesn't always include 'aliases' section #9148

grantr opened this issue Jan 5, 2015 · 3 comments · Fixed by #9178
Assignees

Comments

@grantr
Copy link

grantr commented Jan 5, 2015

The docs say the aliases section is always returned in 1.4:

added in 1.4.0.beta1.

The API will always include an aliases section, even if there aren’t any aliases. Previous versions would not return the aliases section.

http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.4/indices-aliases.html#alias-retrieving

And the breaking changes for 1.4 say the same thing:

The get alias api will return a section for aliases even if there are no aliases.

http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.4/breaking-changes-1.4.html

But my testing shows the opposite: the aliases section is returned always by pre-1.4 versions, and 1.4 only returns the aliases section if aliases exist.

1.3.1:

$ curl localhost:9200/
{
  "status" : 200,
  "name" : "Justine Hammer",
  "version" : {
    "number" : "1.3.1",
    "build_hash" : "2de6dc5268c32fb49b205233c138d93aaf772015",
    "build_timestamp" : "2014-07-28T14:45:15Z",
    "build_snapshot" : false,
    "lucene_version" : "4.9"
  },
  "tagline" : "You Know, for Search"
}

$ curl localhost:9200/_aliases
{"test2":{"aliases":{}},"test1":{"aliases":{}}}%

1.4.0 and 1.4.2:

$ curl localhost:9200
{
  "status" : 200,
  "name" : "Raving Beauty",
  "cluster_name" : "elasticsearch",
  "version" : {
    "number" : "1.4.0",
    "build_hash" : "bc94bd81298f81c656893ab1ddddd30a99356066",
    "build_timestamp" : "2014-11-05T14:26:12Z",
    "build_snapshot" : false,
    "lucene_version" : "4.10.2"
  },
  "tagline" : "You Know, for Search"
}

$ curl localhost:9200/_aliases
{"test":{}}%

Are the docs wrong or is the behavior wrong? (Or maybe I'm wrong)

@clintongormley
Copy link

@colings86 please take a look at this

@colings86
Copy link
Contributor

@grantr thanks for raising an issue for this. You are right that it's a bug. I have created PR #9178 to resolve this and make the behaviour consistent with the documentation

@grantr
Copy link
Author

grantr commented Jan 7, 2015

Thanks @colings86!

colings86 added a commit that referenced this issue Jan 8, 2015
This fix ensures that calls to the GET alias/mappings/settings/warmers APIs return the aliases/mappings/settings/warmers object even if there is no content within them.. This make them consistent with the GET Index API docs and the breaking changes in 1.4 docs

Closes #9148
colings86 added a commit that referenced this issue Jan 8, 2015
This fix ensures that calls to the GET alias/mappings/settings/warmers APIs return the aliases/mappings/settings/warmers object even if there is no content within them.. This make them consistent with the GET Index API docs and the breaking changes in 1.4 docs

Closes #9148
mute pushed a commit to mute/elasticsearch that referenced this issue Jul 29, 2015
This fix ensures that calls to the GET alias/mappings/settings/warmers APIs return the aliases/mappings/settings/warmers object even if there is no content within them.. This make them consistent with the GET Index API docs and the breaking changes in 1.4 docs

Closes elastic#9148
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

Successfully merging a pull request may close this issue.

3 participants