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

[source, php]
----
$params = [
    'body' => [
        'aggs' => [
            'genres' => [
                'terms' => [
                    'field' => 'genre',
                    'script' => [
                        'source' => '\'Genre: \' +_value',
                        'lang' => 'painless',
                    ],
                ],
            ],
        ],
    ],
];
$response = $client->search($params);
----
