我想尝试一下scaled_floatElasticsearch,但无法理解以下内容:
如果我按照文档中的方式为索引创建映射:
PUT my_index
{
"mappings": {
"my_type": {
"properties": {
"price": {
"type": "scaled_float",
"scaling_factor": 100
}
}
}
}
}
Run Code Online (Sandbox Code Playgroud)
然后我向索引添加一些数据,如下所示:
PUT my_index/my_type/1
{
"price" : 100.1599999999
}
Run Code Online (Sandbox Code Playgroud)
我希望得到回报的价格100.16,但结果GET my_index/my_type/1显示:
{
"_index": "my_index",
"_type": "my_type",
"_id": "1",
"_version": 1,
"found": true,
"_source": {
"price": 100.1599999999
}
}
Run Code Online (Sandbox Code Playgroud)
为什么不是圆角的?
或者舍入值仅在索引中使用,我在这里看到的是保存的原始输入,因为它位于“_source”下?如何检查是否发生舍入?
我正在使用 Elasticsearch 5.6.5 和 Lucene 6.6.1
提前致谢!