How to send elasticsearch multi search request in Postman? How to send elasticsearch multi search request in Postman? elasticsearch elasticsearch

How to send elasticsearch multi search request in Postman?


Three things are important here:

  1. When inserting body, select raw radiobutton and Text (or JSON) from dropdown.
  2. Add header: Content-type: application/x-ndjson
  3. Most important: put new line after the last line of your query

Body:enter image description here

Header:

enter image description here

Curl version:

curl -X POST \  http://127.0.0.1:9200/_msearch \  -H 'cache-control: no-cache' \  -H 'content-type: application/x-ndjson' \  -d '{"index":"script","type":"test"}{"query":{"match_all":{}}}'


You can also make your request body be json format and change your Content-Type be application/json, please take a look as below

Header with Content-Type

Your search request with json type

Response data


I have found error for "Expected [START_OBJECT] but found [null]" when I use _msearch API in elasticsearch.

Response of this api

Request parameters and url