Jon*_*ved 2 elasticsearch nest
是否可以_geo_distance使用用于弹性搜索的 NEST 库进行排序?我找不到任何支持。
做我想做的原始json是:
"sort": [
{
"_geo_distance": {
"position": {
"lat": 59.3389428,
"lon": 18.0761637
},
"order": "asc",
"unit": "m",
"distance_type": "plane"
}
}
]
Run Code Online (Sandbox Code Playgroud)
var results = client.Search<object>(sd => sd
.SortGeoDistance(d => d
.OnField("position")
.Unit(GeoUnit.Miles)
.DistanceType(GeoDistance.Plane)
.PinTo(Lat: 59.3389428, Lon: 18.0761637)
.Ascending());
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
455 次 |
| 最近记录: |