Speeding up GET operations (multi-GET)
The standard GET
operation is very fast, but if you need to fetch a lot of documents by ID, Elasticsearch provides the _mget
operation.
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 client, 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 we created in the Indexing a document recipe.
How to do it...
The multi-GET REST URLs are as follows:
http://<server</_mget http://<server>/<index_name>/_mget
To execute a multi-GET action, follow these steps:
- First, we must use the
POST
method with...