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

[source, php]
----
$params = [
    'index' => 'sales',
    'body' => [
        'aggs' => [
            'sales_over_time' => [
                'date_histogram' => [
                    'field' => 'date',
                    'calendar_interval' => '1M',
                    'format' => 'yyyy-MM-dd',
                    'keyed' => true,
                ],
            ],
        ],
    ],
];
$response = $client->search($params);
----
