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

[source, php]
----
$params = [
    'body' => [
        'aggs' => [
            'tags' => [
                'terms' => [
                    'field' => 'tags',
                    'include' => '.*sport.*',
                    'exclude' => 'water_.*',
                ],
            ],
        ],
    ],
];
$response = $client->search($params);
----
