Elasticsearch-score算法介绍
来源:互联网 发布:linux删除用户及目录 编辑:程序博客网 时间:2024/06/08 07:52
relevance score算法,简单来说,就是计算出,一个索引中的文本,与搜索文本,他们之间的关联匹配程度,Elasticsearch使用的是 term frequency/inverse document frequency算法,简称为TF/IDF算法
Term frequency:搜索文本中的各个词条在field文本中出现了多少次,出现次数越多,就越相关
搜索请求:hello world
doc1:hello you, and world is very good
doc2:hello, how are you
Inverse document frequency:搜索文本中的各个词条在整个索引的所有文档中出现了多少次,出现的次数越多,就越不相关
搜索请求:hello world
doc1:hello, today is very good
doc2:hi world, how are you
比如说,在index中有1万条document,hello这个单词在所有的document中,一共出现了1000次;world这个单词在所有的document中,一共出现了100次
doc2更相关
Field-length norm:field长度,field越长,相关度越弱
搜索请求:hello world
doc1:{ “title”: “hello article”, “content”: “babaaba 1万个单词” }
doc2:{ “title”: “my article”, “content”: “blablabala 1万个单词,hi world” }
hello world在整个index中出现的次数是一样多的
doc1更相关,title field更短
我们可以使用以下api来查看一个搜索评分的具体算法:
GET /test_index/test_type/_search?explain{ "query": { "match": { "test_field": "test hello" } }}
- Elasticsearch-score算法介绍
- elasticsearch score 得分 自定义
- Elasticsearch script score plug 教程
- elasticsearch排序(相关性排序score)
- elasticsearch 自定义 script score JavaAPI查询
- Elasticsearch介绍
- 算法入门竞赛3354-score
- Score
- score
- score
- Score
- Score
- Score
- Score
- 通过Function Score Query优化Elasticsearch搜索结果
- 通过Function Score Query优化Elasticsearch搜索结果
- 通过Function Score Query优化Elasticsearch搜索结果
- Elasticsearch 评分score计算中的Boost 和 queryNorm
- 分金子(360公司2017春招真题)
- Objective-C 运行时 iOS
- css引入样式的几种方法
- Time And Datetime
- Tmux 速成教程:技巧和调整
- Elasticsearch-score算法介绍
- PV操作
- 三 无限轮播 无原点
- YOLO9000算法详解
- MyEclipse实现库表数据增删改查
- https的加密方式 介绍 + 常见的加密技术
- SAP物料标准成本估算表
- ZlycerQan和Myj大佬的NOIP模拟赛
- C#基本语法