Getting a document
Once you've indexed a document, during your application's life, it will probably need to be retrieved.
The GET
REST call allows us to get a document in real time without the need to refresh it.
Getting ready
You will need an up-and-running Elasticsearch installation, as we described in the Downloading and installing Elasticsearch recipe of Chapter 1, Getting Started.
To execute the commands in this recipe, you can use any HTTP clients, such as curl (https://curl.haxx.se/), Postman (https://www.getpostman.com/), or others. I suggest using the Kibana console as it provides code completion and better character escaping for Elasticsearch.
To execute the following commands correctly, please use the indexed document from the Indexing a document recipe.
How to do it...
The GET
method allows us to return a document, given its index, type, and ID.
The REST API's URL is as follows:
http://<server>/<index_name>/_doc/<...