resp = client.search( index="my-index-000001", aggs={ "my-agg-name": { "terms": { "field": "my-field" } } }, ) print(resp)