【发布时间】:2019-04-30 11:47:51
【问题描述】:
嘿,我正在开发一个应用程序,我需要根据距离过滤器显示提供的纬度经度的地点。我正在提供来自弹性搜索的数据。我可以使用 geo_distance 查询轻松地提供数据,以查找具有中心点指定距离内的地理点的文档。但我无法搜索超过 x 公里的数据
弹性搜索版本 - 6.6
映射 -
{
"mappings": {
"_doc": {
"properties": {
"location": {
"type": "geo_point"
}
}
}
}
}
为了得到小于 x 公里的地方,我使用这个查询
{
"query": {
"bool" : {
"filter" : {
"geo_distance" : {
"distance" : "15km",
"location" : {
"lat" : 40.1111,
"lon" : 40.1111
}
}
}
}
}
}
使用什么查询来获取大于 x km 的结果,地理过滤器是否提供任何查询参数来获取大于 x 距离的数据? 我可以将过滤器与 must_not 结合使用吗?
【问题讨论】:
标签: elasticsearch