Elasticsearch 7.0 Cookbook(Fourth Edition)
上QQ阅读APP看书,第一时间看更新

How it works...

Multi GET calling is a shortcut for executing many get commands in one shot.

Internally, Elasticsearch spreads the get in parallel on several shards and collects the results to return to the user.

The get object can contain the following parameters:

  • _index: The index that contains the document. It can be omitted if passed in the URL.
  • _id: The document ID.
  • stored_fields: (optional) A list of fields to retrieve.
  • _source: (optional) Source filter object.
  • routing: (optional) The shard routing parameter.

The advantages of a multi GET are as follows:

  • Reduced networking traffic, both internally and externally for Elasticsearch
  • Increased speed if used in an application: the time for processing a multi GET is quite similar to a standard get