我目前正試圖在NEST中實現一個「function_score」查詢,只有在過濾器匹配時纔會應用這些函數。elasticsearch巢功能函數中的過濾器支持
它看起來不像FunctionScoreFunctionsDescriptor支持添加過濾器。這個功能是否會很快被添加?
這裏是想我能夠實現一個超級簡單的例子:
- 運行的ES查詢,基本分數
- 經歷的功能列表,並添加它的第一次得分,其中過濾器匹配我目前使用Elasticsearch V1.1.0
"function_score": {
"query": {...}, // base ES query
"functions": [
{
"filter": {...},
"script_score": {"script": "25"}
},
{
"filter": {...},
"script_score": {"script": "15"}
}
],
"score_mode": "first", // take the first script_score where the filter matches
"boost_mode": "sum" // and add this to the base ES query score
}
,和NEST v 1.0.0-beta1預發佈。
謝謝!
爾加,不知道我是多麼懷念那。我已經嘗試過,它的工作原理。太棒了,謝謝! – IBN