V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX  ›  yn  ›  全部回复第 1 页 / 共 1 页
回复总数  1
2016-06-28 09:22:18 +08:00
回复了 tumayun 创建的主题 Elasticsearch Elasticsearch 如何用 script_fields 计算出来的字段进行排序?
curl -X GET 'http://localhost:9200/users/user/_search?pretty' -d '{
"sort" : [ {
"_geo_distance" : {
"location" : [ {
"lat" : 23.1191,
"lon" : 113.31
} ],
"unit" : "km",
"distance_type" : "arc"
}
}]
}'

使用这个相当于 利用 script_fields 的 distanceInKm 计算 然后排序
关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2168 人在线   最高记录 6543   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 12ms · UTC 05:25 · PVG 13:25 · LAX 22:25 · JFK 01:25
Developed with CodeLauncher
♥ Do have faith in what you're doing.