Matching all of the documents
One of the most common queries is the match_all
query. This kind of query allows the user to return all of the documents that are available in an index. The match_all
query and other query operators are part of the Elasticsearch query DSL.
Getting ready
You will need an up-and-running Elasticsearch installation, as described in the Downloading and installing Elasticsearch recipe in 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 similar. I suggest using the Kibana console as it provides code completion and better character escaping for Elasticsearch.
To correctly execute the following commands, you will need an index populated with the ch04/populate_kibana.txt
 command, which is available in the online code.
How to do it...
In order to execute a match_all
query, we will perform the following...