Elasticsearhc-如何在Sense或Head插件上执行多搜索请求

bat*_*aci 3 elasticsearch

我试图在感觉和插件头上实现这个多搜索请求,但我无法得到什么问题?doc上的示例是curl,我无法理解究竟有什么区别.

POST _msearch?pretty=1 
{"myIndex":"Product"}
{
  "fields": [
      "id",
    "Name"
  ], 
"query": {
 "bool": {
      "should": [
        {
          "query_string": {
            "default_field": "_all",
            "query": "key"
          }
        }
      ] 
    }      

  }
,
  "from": 0,
  "size": 5,
  "sort": [],
  "aggs": {}
}
{"myIndex":"Printer"}{
  "fields": [
      "id",
    "Name"  
  ], 
"query": {
 "bool": { 
      "must": [{
      "has_child": {
     "type": "Printer",
     "query": {
        "match": {
        "Name": "key"
        }
      }
    }
      }]
    }      

  }
,
  "from": 0,
  "size": 5,
  "sort": [],
  "aggs": {}
}
Run Code Online (Sandbox Code Playgroud)

感觉上我得到了这个错误.{"error":"JsonParseException [意外的输入结束:OBJECT的预期关闭标记(来自[来源:[B @ 48acbc4c;行:1,列:0])\n在[来源:[B @ 48acbc4c; line:1,column:3]]","status":500}

Ric*_*cha 6

这是因为有额外的空间.我通过删除额外的空间和下一行来删除此错误.在意义上运行ctrl+I两次到第一次缩进然后取消缩进查询.

希望这会消除错误.