Executing a search
Elasticsearch was born as a search engine; its main purpose is to process queries and give results as quickly as possible. In this recipe, we'll learn that a search in Elasticsearch is not only limited to matching documents—it can also calculate additional information that's required to improve the quality of the search.
Getting ready
You will need an up-and-running Elasticsearch installation, as described in the Downloading and installing Elasticsearch recipe of Chapter 1, Getting Started.
To execute these commands, any HTTP client can be used, such as Curl (https://curl.haxx.se/), Postman (https://www.getpostman.com/), or something similar. I suggest using the Kibana console as it provides code completion and better character escaping.
To correctly execute the following commands, you will need an index populated with the ch04/populate_kibana.txt
commands or the ch04/populate_kibana.sh
script, which is available in the online code...