Kibana 得到这个,parsing_exception:没有 [查询] 注册 [_source] 错误



我试图在 Kibana 中搜索以查找基于代码的产品。为此,我使用了logstash并将我的Oracle数据用于弹性搜索。下面的查询我试图根据代码获取产品,但无法正确获取。我的查询有什么问题吗?

请在弹性搜索中找到我的实际数据:

{  
"took":50,
"timed_out":false,
"_shards":{  
"total":5,
"successful":5,
"skipped":0,
"failed":0
},
"hits":{  
"total":1,
"max_score":1.0,
"hits":[  
{  
"_index":"my_index",
"_type":"doc",
"_id":"MUC8GmMBRU-f7c0A8LUY",
"_score":1.0,
"_source":{  
"@version":"1",
"vendor_id":1,
"name":"prod7",
"code":"12312",
"catalog_id":343,
"is_visible":1,
"@timestamp":"2018-05-01T08:06:16.642Z"
}
}
]
}

请找到我的查询,该查询正在尝试通过 kibana 从弹性搜索中获取记录。

get my_index/_search/
{

"query" :{
"_source":{
"match_all":{"code":"12312"}
}
}
}

我收到以下错误

{
"error": {
"root_cause": [
{
"type": "parsing_exception",
"reason": "no [query] registered for [_source]",
"line": 3,
"col": 15
}
],
"type": "parsing_exception",
"reason": "no [query] registered for [_source]",
"line": 3,
"col": 15
},
"status": 400
}

正确的查询如下所示:

GET my_index/_search/
{
"query" :{
"match": {"code": "12312"}
}
}

最新更新