// aggregations/bucket/terms-aggregation.asciidoc:641

[source, php]
----
$params = [
    'body' => [
        'aggs' => [
            'actors' => [
                'terms' => [
                    'field' => 'actors',
                    'size' => 10,
                ],
                'aggs' => [
                    'costars' => [
                        'terms' => [
                            'field' => 'actors',
                            'size' => 5,
                        ],
                    ],
                ],
            ],
        ],
    ],
];
$response = $client->search($params);
----
