{"action":"created","issue":{"url":"https://api.github.com/repos/elastic/elasticsearch-dsl-py/issues/109","labels_url":"https://api.github.com/repos/elastic/elasticsearch-dsl-py/issues/109/labels{/name}","comments_url":"https://api.github.com/repos/elastic/elasticsearch-dsl-py/issues/109/comments","events_url":"https://api.github.com/repos/elastic/elasticsearch-dsl-py/issues/109/events","html_url":"https://github.com/elastic/elasticsearch-dsl-py/issues/109","id":63317720,"number":109,"title":"README.rst info about aggregations","user":{"login":"sgerlach","id":4514084,"avatar_url":"https://avatars.githubusercontent.com/u/4514084?v=3","gravatar_id":"","url":"https://api.github.com/users/sgerlach","html_url":"https://github.com/sgerlach","followers_url":"https://api.github.com/users/sgerlach/followers","following_url":"https://api.github.com/users/sgerlach/following{/other_user}","gists_url":"https://api.github.com/users/sgerlach/gists{/gist_id}","starred_url":"https://api.github.com/users/sgerlach/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sgerlach/subscriptions","organizations_url":"https://api.github.com/users/sgerlach/orgs","repos_url":"https://api.github.com/users/sgerlach/repos","events_url":"https://api.github.com/users/sgerlach/events{/privacy}","received_events_url":"https://api.github.com/users/sgerlach/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-03-20T22:04:16Z","updated_at":"2015-03-21T06:24:19Z","closed_at":"2015-03-21T06:24:19Z","body":"The example about accessing aggregations looks to be incorrect in the README\r\n\r\n```\r\nfor tag in response['aggregations']['per_tag']['buckets']:\r\n    print(tag['key'], tag['max_lines']['value'])\r\n```\r\n\r\nshould be \r\n```\r\nfor tag in response.aggregations['per_tag']['buckets']:\r\n    print(tag['key'], tag['max_lines']['value'])\r\n```"},"comment":{"url":"https://api.github.com/repos/elastic/elasticsearch-dsl-py/issues/comments/84265592","html_url":"https://github.com/elastic/elasticsearch-dsl-py/issues/109#issuecomment-84265592","issue_url":"https://api.github.com/repos/elastic/elasticsearch-dsl-py/issues/109","id":84265592,"user":{"login":"HonzaKral","id":32132,"avatar_url":"https://avatars.githubusercontent.com/u/32132?v=3","gravatar_id":"","url":"https://api.github.com/users/HonzaKral","html_url":"https://github.com/HonzaKral","followers_url":"https://api.github.com/users/HonzaKral/followers","following_url":"https://api.github.com/users/HonzaKral/following{/other_user}","gists_url":"https://api.github.com/users/HonzaKral/gists{/gist_id}","starred_url":"https://api.github.com/users/HonzaKral/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HonzaKral/subscriptions","organizations_url":"https://api.github.com/users/HonzaKral/orgs","repos_url":"https://api.github.com/users/HonzaKral/repos","events_url":"https://api.github.com/users/HonzaKral/events{/privacy}","received_events_url":"https://api.github.com/users/HonzaKral/received_events","type":"User","site_admin":false},"created_at":"2015-03-21T06:24:19Z","updated_at":"2015-03-21T06:24:19Z","body":"This example in the README shows how this would be done without the dsl library. There an attribute access won't work. The same example, with the use of this library can be found in the next section:\r\n\r\n    for tag in response.aggregations.per_tag.buckets:\r\n        print(tag.key, tag.max_lines.value)\r\n"}}