// This file is autogenerated, DO NOT EDIT
// aggregations/metrics/geocentroid-aggregation.asciidoc:79

[source, python]
----
resp = client.search(
    index="museums",
    size="0",
    aggs={
        "cities": {
            "terms": {
                "field": "city.keyword"
            },
            "aggs": {
                "centroid": {
                    "geo_centroid": {
                        "field": "location"
                    }
                }
            }
        }
    },
)
print(resp)
----
