The previous recipe used mainly numeric fields; Elasticsearch provides special functionalities to compute the date histogram aggregation which operates on date
/datetime
values.
This aggregation is required because date values need more customization to solve problems such as timezone conversion and special time intervals.
You need an up-and-running Elasticsearch installation, as we described in the Downloading and installing Elasticsearch recipe in Chapter 2, Downloading and Setup.
To execute curl
via the command line, you need to install curl
for your operative system.
To correctly execute the following command, you need an index populated with the chapter_08/populate_aggregations.sh
script available in the online code.