{"action":"created","issue":{"url":"https://api.github.com/repos/elastic/kibana/issues/6641","repository_url":"https://api.github.com/repos/elastic/kibana","labels_url":"https://api.github.com/repos/elastic/kibana/issues/6641/labels{/name}","comments_url":"https://api.github.com/repos/elastic/kibana/issues/6641/comments","events_url":"https://api.github.com/repos/elastic/kibana/issues/6641/events","html_url":"https://github.com/elastic/kibana/issues/6641","id":143254608,"number":6641,"title":"Option for exact aggregation instead of approximation","user":{"login":"chrisdrusso","id":4182524,"avatar_url":"https://avatars.githubusercontent.com/u/4182524?v=3","gravatar_id":"","url":"https://api.github.com/users/chrisdrusso","html_url":"https://github.com/chrisdrusso","followers_url":"https://api.github.com/users/chrisdrusso/followers","following_url":"https://api.github.com/users/chrisdrusso/following{/other_user}","gists_url":"https://api.github.com/users/chrisdrusso/gists{/gist_id}","starred_url":"https://api.github.com/users/chrisdrusso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chrisdrusso/subscriptions","organizations_url":"https://api.github.com/users/chrisdrusso/orgs","repos_url":"https://api.github.com/users/chrisdrusso/repos","events_url":"https://api.github.com/users/chrisdrusso/events{/privacy}","received_events_url":"https://api.github.com/users/chrisdrusso/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2016-03-24T14:00:58Z","updated_at":"2016-05-12T22:43:16Z","closed_at":"2016-03-24T20:04:45Z","body":"Kibana ought to have an option to display exact aggregations instead of approximations when returning a subset. For example, when charting the top 50 results, Kibana should be able to request aggregations with a size of 0 (or no size) to get the exact results instead of an approximation, but only display the first 50 buckets in the chart.\r\n\r\nI'm seeing a case where there are three records with the same \"key\" id, one with a \"total_quantity\" field value of 5000, another with 1000 and the third with 0. Each record is on a different shard. When I chart in ascending order on the key term and a size of 50, the key shows up with a total_quantity sum of 0 instead of 6000. This is due to each shard processing only the bottom 50 and than reducing the results.\r\n\r\nIf I use a size of zero, I get accurate results, but the chart is too crowded with data to be useful.\r\n\r\nKibana should have a visualization option (maybe an \"exact\" checkbox) to query elasticsearch with a size of 0 (or no size), but then chart only a subset (such as the top or bottom 50)."},"comment":{"url":"https://api.github.com/repos/elastic/kibana/issues/comments/218906740","html_url":"https://github.com/elastic/kibana/issues/6641#issuecomment-218906740","issue_url":"https://api.github.com/repos/elastic/kibana/issues/6641","id":218906740,"user":{"login":"vrecan","id":852128,"avatar_url":"https://avatars.githubusercontent.com/u/852128?v=3","gravatar_id":"","url":"https://api.github.com/users/vrecan","html_url":"https://github.com/vrecan","followers_url":"https://api.github.com/users/vrecan/followers","following_url":"https://api.github.com/users/vrecan/following{/other_user}","gists_url":"https://api.github.com/users/vrecan/gists{/gist_id}","starred_url":"https://api.github.com/users/vrecan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vrecan/subscriptions","organizations_url":"https://api.github.com/users/vrecan/orgs","repos_url":"https://api.github.com/users/vrecan/repos","events_url":"https://api.github.com/users/vrecan/events{/privacy}","received_events_url":"https://api.github.com/users/vrecan/received_events","type":"User","site_admin":false},"created_at":"2016-05-12T22:43:16Z","updated_at":"2016-05-12T22:43:16Z","body":"yep that was it, thanks!"}}