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

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