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.
Previous
What is the parent-child relationship (join field) in Elasticsearch?
Next
What is dynamic mapping templates in Elasticsearch?
More Elasticsearch Questions
View all →- Intermediate What is the difference between query context and filter context in Elasticsearch?
- Intermediate What is a bool query in Elasticsearch?
- Intermediate What are aggregations in Elasticsearch?
- Intermediate What is the difference between text and keyword field types?
- Intermediate What are index templates and component templates in Elasticsearch?