Skip to content

arloor/es-score-plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

elasticsearch评分插件

拓展script_score来实现自定义评分方式的es插件

使用自定义评分算法来计算文档评分,而不是es内置的bm25算法

使用:

{
  "query": {
    "function_score": {
      "query": {
        "match": {
          "body": "查询词"
        }
      },
      "boost_mode": "replace",
      "functions": [
        {
          "script_score": {
            "script": {
              "source": "term_score",
              "lang": "expert_scripts",
              "params": {
                "field": ["title^2","body^1"],
                "query": "查询词"
              }
            }
          }
        }
      ]
    }
  }
}

About

elasticsearch 评分插件

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages