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)
本文转自whk66668888 51CTO博客,原文链接:http://blog.51cto.com/12597095/1903763