簡體   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