Once it receives answers from each node, it collates their responses
into a single response, which it returns to the client.
[[img-distrib-mget]]
.Retrieving multiple documents with mget
image::images/04-05_mget.png[“Retrieving multiple documents with mget”]
Below we list the sequence of steps necessary to retrieve multiple documents
with a single mget
request, as depicted in <
A parameter can be set for each document in the docs
array,
and the preference
parameter can be set for the top-level mget
request.
[[img-distrib-bulk]]
.Multiple document changes with bulk
image::images/04-06_bulk.png[“Multiple document changes with bulk”]
The client sends a
bulk
request toNode_1
.The primary shard executes each action serially, one after another. As each
action succeeds, the primary forwards the new document (or deletion) to its
replica shards in parallel, then moves on to the next action. Once all
replica shards report success for all actions, the node reports success to
the requesting node, which collates the responses and returns them to the
client.