curl -XGET ‘http://localhost:9200/searchsuggestion/searchsuggestion/_search?pretty‘ -d ‘{
"fields" : ["company_full_name","id"],
"size" : 10,
"query": {
"function_score": {
"functions": [
{
"filter": { "term": { "pinyin_name": "bx" } },
"weight": 100
},
{
"filter": { "term": { "blurry": "bx" } },
"weight": 10
},
{
"field_value_factor" : {
"field" : "frequency",
"factor" : 0.1,
"modifier" : "ln"
}
}
],
"score_mode": "sum"
}
}
}‘
解释
score=pinyin_name*100+blurry*10+ln(0.1*frequency)
时间: 2024-08-08 16:02:33