Multi search allows us to group search requests together. It is similar to the multi-get and the other bulk APIs. By grouping the requests together, we can save the network round trips and execute the queries in the request in parallel. We can control the number of the requests that are executed in parallel. A simple multi search request is shown here:
#Multi Search
GET chapter7/_msearch
{"type" : "product"}
{"query" : {"match_all" : {}}, "from" : 0, "size" : 10}
{"type" : "product_review"}
{"query" : {"match_all" : {}}}
The response of the multi search query is a list of responses. Each request is executed independently, and the failure of one request will not affect the others. The response to the preceding query will contain responses to two queries as shown next:
{
...