任何人都可以告诉我在ElasticSearch中如何使用function_score返回距离我的代码如下所示。
function_score: {
query: {
query_string: {
query: shop_search,
fields: [ 'shop_name', 'address.state', 'address.city', 'address.country', 'address.street']
}
},
// boost: 5.0,
gauss: {
_score,
location: {
origin: { lat: 12.8748964,
lon: 77.6413239
},
scale: "0.1km",
offset: "0km",
decay: "0.000005"
}
}
}