How to send elasticsearch multi search request in Postman?

后端 未结 3 1333
-上瘾入骨i
-上瘾入骨i 2021-02-05 05:21

I\'m trying to send elasticserach multi search request via postman as below:

POST - http://localhost:9200/_msearch
content-type : x-www-form-urlencoded
body:
{\"         


        
相关标签:
3条回答
  • 2021-02-05 05:37

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

    0 讨论(0)
  • 2021-02-05 05:38

    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

    0 讨论(0)
  • 2021-02-05 05:49

    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:

    Header:

    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":{}}}
    '
    
    0 讨论(0)
提交回复
热议问题