7

我尝试显示 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" }
          }
        }
      }
    }
  }
}

你知道我怎样才能显示带有嵌套对象的面板吗?实施了吗?

谢谢,凯文

4

2 回答 2

0

这显然是一个 Kibana 错误。Kibana 生成的构面查询缺少用于指示这一点的“嵌套”字段。

于 2014-11-04T08:54:43.630 回答
0

您在映射中缺少一个参数(“include_in_parent”:true)。正确的映射应该是:

{
  "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" }
          }
        }
      }
    }
  }
}
于 2014-08-25T18:45:43.523 回答