Ra *_* Ka 18 elasticsearch postman
我正在尝试通过postman发送elasticserach多搜索请求,如下所示:
POST - http://localhost:9200/_msearch
content-type : x-www-form-urlencoded
body:
{"index":"accounts"}
{"query":{"bool":{"should":[{"match":{"owner.first_name":"Creeple"}}]}}}
Run Code Online (Sandbox Code Playgroud)
但是,我收到以下错误:
{
"error": {
"root_cause": [
{
"type": "parse_exception",
"reason": "Failed to derive xcontent"
}
],
"type": "parse_exception",
"reason": "Failed to derive xcontent"
},
"status": 400
}
Run Code Online (Sandbox Code Playgroud)
请注意,如果我通过播放代码执行相同的请求,则会成功获取结果.
WS.url("localhost:9200/_msearch").withHeaders("Content-type" -> "application/x-www-form-urlencoded").post(query)
Run Code Online (Sandbox Code Playgroud)
Joa*_*nna 28
这里有三件事很重要:
标题:
卷曲版本:
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":{}}}
'
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
28272 次 |
| 最近记录: |