gpt4 book ai didi

elasticsearch - Kibana : Visualization does not add floating values

转载 作者:行者123 更新时间:2023-12-02 23:00:01 25 4
gpt4 key购买 nike

这是我的专栏之一

enter image description here

因此,所有这些值加起来为 1.272。现在我尝试为它创建一个度量可视化,但我得到了

enter image description here

为什么是0?该字段是索引中的数字类型。

更新

所以我试着有意义地运行这个

post indexName/_search
{
"size": 0,
"aggs": {
"sum block": {
"sum": {
"field": "blockSize"
}
}
}
}
}
}

我明白了
{
"took": 4,
"timed_out": false,
"_shards": {
"total": 5,
"successful": 5,
"failed": 0
},
"hits": {
"total": 12,
"max_score": 0,
"hits": []
},
"aggregations": {
"sum block": {
"value": 0
}
}
}

为什么会这样?它不应该加起来浮点值吗?同样,在索引映射中
"blockSize": {
"type": "long"
}

这不应该是浮点数还是双倍?如果它很长,那么为什么它会在值中存储小数点?

最佳答案

可能第一个被索引的文档有 blockSize: 0因此 ES 选择了 long 类型来映射该字段。现在,浮点值被存储,但 0 被索引(因为它很长)。

您需要删除索引,更正映射并重新索引数据。

关于elasticsearch - Kibana : Visualization does not add floating values,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37056580/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com