[英]How to send elasticsearch multi search request in Postman?
I'm trying to send elasticserach multi search request via postman as below:我正在尝试通过邮递员发送 elasticserach 多搜索请求,如下所示:
POST - http://localhost:9200/_msearch
content-type : x-www-form-urlencoded
body:
{"index":"accounts"}
{"query":{"bool":{"should":[{"match":{"owner.first_name":"Creeple"}}]}}}
However, I'm getting following error:但是,我收到以下错误:
{
"error": {
"root_cause": [
{
"type": "parse_exception",
"reason": "Failed to derive xcontent"
}
],
"type": "parse_exception",
"reason": "Failed to derive xcontent"
},
"status": 400
}
Note that if I perform same request via my play code, results are succesfully fetched.请注意,如果我通过播放代码执行相同的请求,则会成功获取结果。
WS.url("localhost:9200/_msearch").withHeaders("Content-type" -> "application/x-www-form-urlencoded").post(query)
Three things are important here:这里有三件事很重要:
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":{}}}
'
I have found error for "Expected [START_OBJECT] but found [null]" when I use _msearch API in elasticsearch.当我在 elasticsearch 中使用 _msearch API 时,我发现“预期 [START_OBJECT] 但发现 [null]”错误。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.