belogik/goes — pull request #4 by bobrik (2014-02-27 12:37:00+00:00)
Title: Aggregations support

This PR adds support for aggregations framework added in elasticsearch 1.0.

This code will show average age by sex by country:

```go
resp, err := conn.Search(query, []string{*index}, []string{})
if err != nil {
log.Fatal(err)
}

sex := resp.Aggregations["sex"]

for _, sexBucket := range sex.Buckets() {
log.Printf("sex: %f", sexBucket.Key())
country := sexBucket.Aggregation("country")

for _, countryBucket := range country.Buckets() {
log.Printf(" country: %s", countryBucket.Key())

age := countryBucket.Aggregation("age")

log.Printf(" avg age: %f", age["value"])
}
}
```

I'm looking for feedback before adding tests :)