{"action":"created","issue":{"url":"https://api.github.com/repos/elastic/elasticsearch/issues/4915","labels_url":"https://api.github.com/repos/elastic/elasticsearch/issues/4915/labels{/name}","comments_url":"https://api.github.com/repos/elastic/elasticsearch/issues/4915/comments","events_url":"https://api.github.com/repos/elastic/elasticsearch/issues/4915/events","html_url":"https://github.com/elastic/elasticsearch/issues/4915","id":26393327,"number":4915,"title":"Paging support for aggregations","user":{"login":"aaneja","id":1797669,"avatar_url":"https://avatars.githubusercontent.com/u/1797669?v=3","gravatar_id":"","url":"https://api.github.com/users/aaneja","html_url":"https://github.com/aaneja","followers_url":"https://api.github.com/users/aaneja/followers","following_url":"https://api.github.com/users/aaneja/following{/other_user}","gists_url":"https://api.github.com/users/aaneja/gists{/gist_id}","starred_url":"https://api.github.com/users/aaneja/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aaneja/subscriptions","organizations_url":"https://api.github.com/users/aaneja/orgs","repos_url":"https://api.github.com/users/aaneja/repos","events_url":"https://api.github.com/users/aaneja/events{/privacy}","received_events_url":"https://api.github.com/users/aaneja/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/elastic/elasticsearch/labels/:Aggregations","name":":Aggregations","color":"009800"},{"url":"https://api.github.com/repos/elastic/elasticsearch/labels/discuss","name":"discuss","color":"fbca04"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":18,"created_at":"2014-01-27T20:48:34Z","updated_at":"2015-04-10T16:03:33Z","closed_at":null,"body":"Terms aggregation  does not support a way to page through the buckets returned.\r\nTo work around this, I've been trying to set 'min_doc_count'  to limit the buckets returned and using a 'exclude' filter, to exclude already 'seen' pages.\r\n\r\nWill this result in better running time performance on the ES cluster as compared to getting all the buckets and then doing my own paging logic client side ?\r\n"},"comment":{"url":"https://api.github.com/repos/elastic/elasticsearch/issues/comments/91601921","html_url":"https://github.com/elastic/elasticsearch/issues/4915#issuecomment-91601921","issue_url":"https://api.github.com/repos/elastic/elasticsearch/issues/4915","id":91601921,"user":{"login":"dakrone","id":19060,"avatar_url":"https://avatars.githubusercontent.com/u/19060?v=3","gravatar_id":"","url":"https://api.github.com/users/dakrone","html_url":"https://github.com/dakrone","followers_url":"https://api.github.com/users/dakrone/followers","following_url":"https://api.github.com/users/dakrone/following{/other_user}","gists_url":"https://api.github.com/users/dakrone/gists{/gist_id}","starred_url":"https://api.github.com/users/dakrone/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dakrone/subscriptions","organizations_url":"https://api.github.com/users/dakrone/orgs","repos_url":"https://api.github.com/users/dakrone/repos","events_url":"https://api.github.com/users/dakrone/events{/privacy}","received_events_url":"https://api.github.com/users/dakrone/received_events","type":"User","site_admin":false},"created_at":"2015-04-10T16:03:33Z","updated_at":"2015-04-10T16:03:33Z","body":"We discussed this and one potential idea is to add the ability to specify a `start_term` for aggregations, that would allow the aggregation to skip all of the preceding terms, then the client could implement the paging by retrieving the first page of aggregations, then sending the same request with the `start_term` being the last term of the previous results. Otherwise the aggregation will still incur the overhead of computing the results and sub-aggregations for each of the \"skipped\" buckets.\r\n\r\nTo better understand this, it would be *extremely* useful to get more use-cases out of why people need this and how they would use it, so please do add those to this ticket."}}