Kibana我得到了这个,在[查询]错误之后解析:[multi_match]未知令牌[START_OBJECT]

时间:2018-05-24 10:46:15

标签: elasticsearch search kibana elasticsearch-5

我尝试使用multi_match查询通过kibana从elasticsearch获取记录,但我收到了错误响应。

请在下面找到我的多重匹配查询。

GET /_search
{
  "query": {
    "multi_match" : {
     "query": {
        "prefix" : { "code" : "M" }
    }
      "fields": [ "code", "_id" ] 
    }
  }
}

我收到以下错误回复。

{
  "error": {
    "root_cause": [
      {
        "type": "parsing_exception",
        "reason": "[multi_match] unknown token [START_OBJECT] after [query]",
        "line": 4,
        "col": 15
      }
    ],
    "type": "parsing_exception",
    "reason": "[multi_match] unknown token [START_OBJECT] after [query]",
    "line": 4,
    "col": 15
  },
  "status": 400
}

1 个答案:

答案 0 :(得分:1)

您无法将prefix查询与multi_match合并,具体取决于您的映射,您可能会这样做:

GET /_search
{
    "query": {
        "query_string" : {
            "default_field" : "*",
            "query" : "M*"
        }
    }
}