// aggregations/bucket/datehistogram-aggregation.asciidoc:119

[source, php]
----
$params = [
    'index' => 'sales',
    'body' => [
        'aggs' => [
            'sales_over_time' => [
                'date_histogram' => [
                    'field' => 'date',
                    'calendar_interval' => 'month',
                ],
            ],
        ],
    ],
];
$response = $client->search($params);
----
