What is the multi-search (msearch) API in Elasticsearch?

Answer

The Multi Search API (POST /_msearch) allows you to bundle multiple search requests into a single HTTP request, reducing network overhead. The request body alternates between a header line (specifying the index and search type) and a body line (the search request JSON). This is useful for dashboards that need to execute many independent queries simultaneously — instead of making 10 separate HTTP requests, you make one. The response contains an array of results, one per query. Kibana uses msearch extensively to populate its dashboards efficiently. Note that all queries still execute concurrently on the cluster, so it does not reduce cluster CPU load, only client-server network round trips.