elasticsearchsearchkibanakibana-5

Kibana am getting this, parsing_exception : no [query] registered for [_source] error


Am trying to search in Kibana to find products based on code. For that i used logstash and get my Oracle data to elastic search. Below query am trying to fetch the product based on code and am not able to get it properly. Is that anything wrong with my query ?

Please find my actual data present in elastic search :

 {  
   "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"
        }
     }
  ]
 }

Please find my query that am trying to fetch record from elasticsearch via kibana.

get my_index/_search/
    {


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

Am getting the below error

{
  "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
}

Solution

  • The correct query looks like this:

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