2014-02-05 16 views
7

我試圖顯示Kibana儀表板,它運行良好。不幸的是,當我想添加包含公司位置的國家/地區的餅圖(或其他表示)時,我有一個空的面板。在kibana面板中使用嵌套字段

我能夠使用kibana查詢來篩選特定的國家,但我無法顯示嵌套文檔的面板。

我的映射(我不得不使用嵌套的字段,因爲一個公司可以有多個位置):

{ 
    "settings" : { 
    "number_of_shards" : 1 
    }, 
    "mappings": { 
    "company" : { 
     "properties" : { 
     "name" : { "type" : "string", "store" : "yes" }, 
     "website" : { "type" : "string", "store" : "yes" }, 
     "employees" : { "type" : "string", "store" : "yes" }, 
     "type": { "type" : "string", "store" : "yes" }, 
     "locations" : { 
      "type" : "nested", 
      "properties" : { 
      "city" : { "type" : "string", "store" : "yes" }, 
      "country" : { "type" : "string", "store" : "yes" }, 
      "coordinates" : { "type" : "geo_point", "store" : "yes" } 
      } 
     } 
     } 
    } 
    } 
} 

你知道我怎麼能顯示面板嵌套的對象?它是否實施?

感謝, 凱文

+0

我假設你已經嘗試使用「locations.country」作爲術語面板中的選定字段? – Aldian

回答

0

你缺少一個參數( 「include_in_parent」:真)在映射。 正確的映射應該是:

{ 
    "settings" : { 
    "number_of_shards" : 1 
    }, 
    "mappings": { 
    "company" : { 
     "properties" : { 
     "name" : { "type" : "string", "store" : "yes" }, 
     "website" : { "type" : "string", "store" : "yes" }, 
     "employees" : { "type" : "string", "store" : "yes" }, 
     "type": { "type" : "string", "store" : "yes" }, 
     "locations" : { 
      "type" : "nested", 
      "include_in_parent": true, 
      "properties" : { 
      "city" : { "type" : "string", "store" : "yes" }, 
      "country" : { "type" : "string", "store" : "yes" }, 
      "coordinates" : { "type" : "geo_point", "store" : "yes" } 
      } 
     } 
     } 
    } 
    } 
} 
+0

在kibana 3上添加include_in_parent:true不會像上面的location.country那樣製作嵌套對象,而是通過kibana進行映射。 – nishant

0

這顯然是一個Kibana錯誤。由Kibana生成的構面查詢缺少「嵌套」字段來表明這一點。