The multi-search API
Similar to the Bulk API, Elasticsearch provides you with a way to gather multiple search (_msearch) requests together to send out in a batch. You need to put the header and the corresponding request body as a pair in the multi-search request body. You can specify the appropriate index names and parameters in the header, including search_type, preference, and routing. The header content type must be set to the newline delimited JSON format (application/x-ndjson).
Now, let's look at an example to issue an _msearch request that contains two sub-requests to find those EFTs in the cf_etf and cf_view indices that do not have the rating field. In the following screenshot, you can see that the response body has a responses
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access