简体   繁体   English

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

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

I am trying to achieve this multi search request on sense and plugin head but I am not able to get what could be the problem? 我试图在感觉和插件头上实现这个多搜索请求,但我无法得到可能是什么问题? sample on doc is for curl, I cant comprehend what is the exact difference. 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": {}
}

I am getting this error on sense. 感觉上我得到了这个错误。 { "error": "JsonParseException[Unexpected end-of-input: expected close marker for OBJECT (from [Source: [B@48acbc4c; line: 1, column: 0])\\n at [Source: [B@48acbc4c; line: 1, column: 3]]", "status": 500 } {“error”:“JsonParseException [意外的输入结束:OBJECT的预期关闭标记(来自[来源:[B @ 48acbc4c;行:1,列:0])\\ n在[来源:[B @ 48acbc4c; line:1,column:3]]“,”status“:500}

This is because of extra spaces. 这是因为有额外的空间。 I got this error removed by removing extra space and next lines. 我通过删除额外的空间和下一行来删除此错误。 In sense Run ctrl+I twice to first indent and then un-indent the query. 在意义上运行ctrl+I两次到第一次缩进然后取消缩进查询。

Hope this will remove the error. 希望这会消除错误。

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

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