简体   繁体   中英

Aggregating Nested Fields in Kibana /Elastic Search

I have defined an Index in elastic cache 6

PUT my_index
{
 "mappings": {
  "_doc": {
  "properties": {
    "user": {
      "type": "nested" 
       }
      }
     }
  }
 }

and loaded some same data as follows

 PUT my_index/_doc/1
{
 "group" : "coach",
"user" : [
    {
    "first" : "John",
    "last" :  "Frank"
   },
   {
    "first" : "Hero",
    "last" :  "tim"
   }
  ]
}

PUT my_index/_doc/2
{
 "group" : "team",
"user" : [
    {
    "first" : "John",
    "last" :  "term"
   },
   {
    "first" : "david",
    "last" :  "gayle"
   }
  ]
}

Now I am trying to search in the discover page or the visualization page, but I receive a blank

加载数据

发现搜索结果

可视化

after a bit of trial and error and googling around i found that does not support nested type for aggregation and search out of the box. To enable this you must install a plugin and the best plugin i found is listed below.

https://ppadovani.github.io/knql_plugin/overview/

The plugin provides all the features from the discover tab to the visualization tab.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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