// This file is autogenerated, DO NOT EDIT
// aggregations/bucket/terms-aggregation.asciidoc:731

[source, python]
----
resp = client.search(
    aggs={
        "actors": {
            "terms": {
                "field": "actors",
                "size": 10,
                "collect_mode": "breadth_first"
            },
            "aggs": {
                "costars": {
                    "terms": {
                        "field": "actors",
                        "size": 5
                    }
                }
            }
        }
    },
)
print(resp)
----
