The standard GET operation is very fast, but if you need to fetch a lot of IDs, ElasticSearch provides the multi get operation.
You need a working ElasticSearch cluster and the document index explained in the Indexing a document recipe.
The following are the multi GET REST URLs:
http://<server</_mget
http://<server>/<index_name>/_mget
http://<server>/<index_name>/<type_name>/_mget
For executing a multi GET action, we need to perform the following steps:
It is the GET method, but it requires a body with IDs and the index/type if they are missing.
The following is an example which uses the first URL, but we need to provide the
index
,type
, andid
parameters:curl 'localhost:9200/_mget' -d '{ "docs" : [ { "_index" : "myindex", "_type" : "order", "_id" : "2qLrAfPVQvCRMe7Ku8r0Tw" }, { "_index" : "myindex", "_type" : "order", ...