When searching for results, the most common criterion for sorting in Elasticsearch is the relevance to a text query.
Real-world applications often need to control the sorting criteria in scenarios, such as the following:
You need an up-and-running Elasticsearch installation as used in the Downloading and installing Elasticsearch recipe in Chapter 2, Downloading and Setup.
curl via the command line, you need to install
curl for your operating system.
To correctly execute the following commands, you will need an index populated with the