ElasticSearch中的以下查询将给予位于指定距离内的结果。结果不包括实际距离。有什么方法可以在ElasticSearch中获得此信息吗?
"query": {
"bool" : {
"must" : {
"match_all" : {}
},
"filter" : {
"geo_distance" : {
"distance" : "12km",
"pin.location" : [-70, 40]
}
}
}
}
1条答案
按热度按时间e4eetjau1#
使用与
geo_distance
筛选器中具有相同参考点的脚本字段。完整查询:或
geo-sort,您将获得排序响应中包含的距离信息。