Using a wildcard query
The wildcard
query is used when a part of a term is known. It allows the completion of truncated or partial terms. These queries are very famous because they are often used for commands on files within system shells (that is, ls *.jpg
).
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 the commands, any HTTP client can be used, such as Curl (https://curl.haxx.se/), Postman (https://www.getpostman.com/), or similar. I suggest you use 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...
To execute a wildcard
query, we will perform the following steps:
- We will execute a
wildcard...