我需要使用 Java API 实现以下 function_score 查询。我在elasticsearch的Java API部分找不到任何关于function_score查询的官方文档
{
"size": 40,
"query": {
"function_score": {
"functions": [
{
"gauss": {
"location": {
"origin": {
"lat": 39.99606,
"lon": 116.480484
},
"offset": "2km",
"scale": "3km"
}
}
}
],
"score_mode": "sum",
"boost_mode": "replace",
"query": {
"bool": {
"must": [
{
"range": {
"startTime": {
"from": "2016-04-12T12:00:00.000Z",
"to": "2016-04-12T16:00:00.000Z",
"include_lower": true,
"include_upper": true
}
}
},
{
"range": {
"endTime": {
"from": "2016-04-12T12:00:00.000Z",
"to": "2016-04-12T16:00:00.000Z",
"include_lower": true,
"include_upper": true
}
}
}
]
} …Run Code Online (Sandbox Code Playgroud)