【发布时间】:2017-10-21 01:03:28
【问题描述】:
是否可以在 geo_point 字段上使用最大或最小聚合?
我尝试将max 直接添加到我的坐标属性上,该属性的类型为geo_point
{
"size": 0,
"aggs" : {
"max_lat" : { "max" : { "field" : "coordinate" } }
}
}
这可以理解地返回一个ClassCastException,因此我尝试直接在coordinate 的lat 或lon 字段上运行查询,它们是double 类型。
{
"size": 0,
"aggs" : {
"max_lat" : { "max" : { "field" : "coordinate.lat" } },
"max_lon" : { "max" : { "field" : "coordinate.lon" } }
}
}
现在我没有收到 ClassCastExcxeption 并且查询返回 200 但是聚合为空。
回复:
{
"aggregations": {
"max_lat": {
"value": null
},
"max_lon": {
"value": null
}
}
}
使用elasticsearch v1.7
【问题讨论】: