繁体   English   中英

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

[英]Elasticsearch- how to do multi search request on Sense or Head plugin

我试图在感觉和插件头上实现这个多搜索请求,但我无法得到可能是什么问题? 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": {}
}

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

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

希望这会消除错误。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM