Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/arloor/es-score-plugin
elasticsearch 评分插件
https://github.com/arloor/es-score-plugin
Last synced: 1 day ago
JSON representation
elasticsearch 评分插件
- Host: GitHub
- URL: https://github.com/arloor/es-score-plugin
- Owner: arloor
- Created: 2020-04-27T02:37:45.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2021-08-09T20:59:39.000Z (about 3 years ago)
- Last Synced: 2024-05-21T08:19:53.960Z (5 months ago)
- Language: Java
- Homepage:
- Size: 26.4 KB
- Stars: 7
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## elasticsearch评分插件
拓展script_score来实现自定义评分方式的es插件
使用自定义评分算法来计算文档评分,而不是es内置的bm25算法
使用:
```json
{
"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": "查询词"
}
}
}
}
]
}
}
}
```