0

我的文档中有 3 个 JSON 键值对,我将它们插入到 elasticsearch 中并使用 Kibana4 进行可视化。这 3 个 JSON 键是NT,XTYT. 对于所有三个键,这些值通常是介于 100 和 1000 之间的整数。一些典型值为543和。当我可视化 Kibana4 中的键时,对于上述三个键中的每一个,我都会收到以下警告。328753

This is an analyzed string field.Analyzed string fields are highly unique and can use a lot of memory to visualize

为了解决上述问题,我使用下面的 shell 脚本为document type包含这些键的弹性搜索创建映射。

我的弹性搜索索引是bits,我的文档类型是nts,我正在尝试为类型long文档中的 3 个 JSON 键分配类型,ntsNT,XTYT.

#!/bin/bash

curl -XPUT 'http://localhost:9200/bits/nts/_mapping' -d '
{
        "events" : {
            "dynamic" : "strict",
            "properties" : {
                "NT" : {
                        type : "long" 
                 },
                "XT" : {
                        type : "long" 
                 },
                "YT"  : {
                        type : "long" 
                }
            }
        },
}'

上面的映射不能解决问题,我仍然收到analyzed string field警告。有人可以指出可能出了什么问题吗?

4

1 回答 1

3

通过检查 Kibana 中发现选项卡上的单个索引文档 JSON,确保您的字段实际上被索引为整数(即​​数字周围没有引号)。

您可能需要更改应用程序索引数据的方式。此处描述的 index.mapping.ignore_malformed 和 index.mapping.coerce 设置也可能会有所帮助。

还可以尝试转到设置 -> 索引 -> 并单击 Kibana 中的“重新加载字段列表”按钮,因为它会缓存字段类型。

最后,如果您使用带时间戳的索引模式(如 [logstash-]YYYY.MM.DD),您可能需要重命名或删除旧索引,您的字段被索引为字符串

于 2015-04-11T02:18:53.673 回答