Run multiple searches

  • POST also GET /{index}/_msearch
  • POST also GET /_msearch

The format of the request is similar to the bulk API format and makes use of the newline delimited JSON (NDJSON) format. The structure is as follows:

header\n
body\n
header\n
body\n
		

This structure is specifically optimized to reduce parsing if a specific search ends up redirected to another node.

IMPORTANT: The final line of data must end with a newline character \n. Each newline character may be preceded by a carriage return \r. When sending requests to this endpoint the Content-Type header should be set to application/x-ndjson.

  • Index privileges: read

Path Parameters

index union IndexName | [] IndexName optional

Comma-separated list of data streams, indices, and index aliases to search.

Leave it out to use /_msearch.

Response