[source, ruby]
----
response = client.search(
  index: 'museums',
  size: 0,
  body: {
    aggregations: {
      cities: {
        terms: {
          field: 'city.keyword'
        },
        aggregations: {
          centroid: {
            geo_centroid: {
              field: 'location'
            }
          }
        }
      }
    }
  }
)
puts response
----
