0
PUT test/foo/1
{
"num": 100
}
GET test/foo/_search
{
"query" : {
"function_score" : {
"query" : {
"match" : {
"num": 100
}
},
"functions" : [
{
"filter" : {
"match_all" : {
}
},
"gauss" : {
"num" : {
"origin": 0,
"scale" : 500,
"offset" : 0,
"decay" : 0.1
},
"multi_value_mode" : "MIN"
}
}
],
"score_mode" : "sum",
"max_boost" : 3.4028235E38
}
}
}
---
{
"hits": {
"total": 1,
"max_score": 0.91201085,
"hits": [
{
"_index": "test",
"_type": "foo",
"_id": "1",
"_score": 0.91201085,
"_source": {
"num": 100
}
}
]
}
}
在我使用的總和作爲評分模式。由於查詢的得分是1,衰變函數的得分是0.91201085
我期望得分是1.91201085
。我錯過了什麼?
沒錯,'boost_mode'是結合了function_score成績查詢分數,而'score_mode'是針對不同的分數相結合的內部'functions'。 – christinabo