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

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