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

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