gpt4 book ai didi

elasticsearch - 带有数组的Geopoint

转载 作者:行者123 更新时间:2023-12-03 01:36:56 24 4
gpt4 key购买 nike

我有一个DOC“公司”和一个TYPE“用户”。在“用户”内部,有一个名为“位置”的字段,这是一个数组。每个位置都有一个名为“point”的字段,该字段是GeoPoint,为字符串“40.748770,-73.985487”。我如何获得该点附近的点?

我在下面显示的这个示例波纹管无法正常工作:

GET /company/user/_search
{
"query": {
"bool" : {
"must" : {
"match_all" : {}
},
"filter" : {
"geo_distance" : {
"distance" : "500m",
"locations.point" : "40.748770, -73.985487"
}
}
}
}
}

最佳答案

以下示例可能会对您有所帮助,

GET /company/user/_search
{
"query": {
"filtered": {
"filter": {
"geo_distance": {
"distance": "1km",
"location": {
"lat": 40.715,
"lon": -73.988
}
}
}
}
}
}

关于elasticsearch - 带有数组的Geopoint,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51712999/

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