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

[source, php]
----
$params = [
    'index' => 'sales',
    'body' => [
        'aggs' => [
            'sale_date' => [
                'date_histogram' => [
                    'field' => 'date',
                    'calendar_interval' => 'year',
                    'missing' => '2000/01/01',
                ],
            ],
        ],
    ],
];
$response = $client->search($params);
----
