elasticsearch/elasticsearch — pull request #4894 by uboness (2014-01-27 09:18:50+00:00)
Title: cleanup of aggregations api

- add javadocs
- remove Iterable from all multi-bucket aggregations
- all single-bucket aggregations should have getDocCount() and getAggregations()
- all multi-bucket aggregations should have getBuckets() that returns Collection
- every bucket in all multi-bucket aggregations should have these methods:
- getKey() : String
- getKeyAsText() : Text
- getKeyAsNumber() : Number (if the key can be numeric value, eg. range & histograms)
- getKeyAsGeoPoint() : GeoPoint (in case of the geohash_grid agg)