lucene内置的评分函数
For multiterm queries, Lucene takes the Boolean model, TF/IDF, and the vector space model and combines them in a single efficient package that collects matching documents and scores them as it goes.
A multiterm query like
GET /my_index/doc/_search
{
"query": {
"match": {
"text": "quick fox"
}
}
}
As soon as a document matches a query, Lucene calculates its score for that query, combining the scores of each matching term. The formula used for scoring is called the practical scoring function.
score(q,d) =
![]()
queryNorm(q)
![]()
· coord(q,d)
![]()
· ∑ (
![]()
tf(t in d)
![]()
· idf(t)²
![]()
· t.getBoost()
![]()
· norm(t,d)
![]()
) (t in q)
![]()
|
|
|
|
|
|
|
|
|
|
|
The sum of the weights for each term |
|
|
|
|
|
|
|
|
|
|
|
|
You should recognize score, tf, and idf. The queryNorm, coord, t.getBoost, and norm are new.
We will talk more about query-time boosting later in this chapter, but first let’s get query normalization, coordination, and index-time field-level boosting out of the way.
Query Normalization Factor
queryNorm = 1 / √sumOfSquaredWeights
![]()
|
|
The |
The same query normalization factor is applied to every document, and you have no way of changing it. For all intents and purposes, it can be ignored. (每个文档都有这个因子,说明它没有什么卵用!)
Query Coordination
The coordination factor (coord) is used to reward documents that contain a higher percentage of the query terms. The more query terms that appear in the document, the greater the chances that the document is a good match for the query.
The coordination factor results in the document that contains all three terms being much more relevant than the document that contains just two of them.
lucene内置的评分函数的更多相关文章
- JMeter 内置日期(时间)函数总结
JMeter 内置日期(时间)函数总结 by:授客 QQ:1033553122 1. 测试环境 apache-jmeter-3.3 下载地址: http://jmeter.apache.org/c ...
- Hive 文件格式 & Hive操作(外部表、内部表、区、桶、视图、索引、join用法、内置操作符与函数、复合类型、用户自定义函数UDF、查询优化和权限控制)
本博文的主要内容如下: Hive文件存储格式 Hive 操作之表操作:创建外.内部表 Hive操作之表操作:表查询 Hive操作之表操作:数据加载 Hive操作之表操作:插入单表.插入多表 Hive语 ...
- python 练习题:请利用Python内置的hex()函数把一个整数转换成十六进制表示的字符串
# -*- coding: utf-8 -*- # 请利用Python内置的hex()函数把一个整数转换成十六进制表示的字符串 n1 = 255 n2 = 1000 print(hex(n1)) pr ...
- python(内置高阶函数)
1.高阶函数介绍: 一个函数可以作为参数传给另外一个函数,或者一个函数的返回值为另外一个函数(若返回值为该函数本身,则为递归),如果满足其一,则为高阶函数. 常见的高阶函数:map().sorted( ...
- Python中匿名函数与内置高阶函数详解
大家好,从今天起早起Python将持续更新由小甜同学从 初学者的角度 学习Python的笔记,其特点就是全文大多由 新手易理解 的 代码与注释及动态演示 .刚入门的读者千万不要错过! 很多人学习pyt ...
- classmethod、staticclassmethod内置装饰器函数
# method 英文是方法的意思 # classmethod 类方法 # 当一个类中的方法中只涉及操作类的静态属性时,此时在逻辑上,我们想要直接通过类名就可以调用这个方法去修改类的静态属性,此时可以 ...
- property内置装饰器函数和@name.setter、@name.deleter
# property # 内置装饰器函数 只在面向对象中使用 # 装饰后效果:将类的方法伪装成属性 # 被property装饰后的方法,不能带除了self外的任何参数 from math import ...
- Thinkphp内置截取字符串函数
Thinkphp内置了一个可以媲美smarty的模板引擎,给我们带来了很大的方便.调用函数也一样,可以和smarty一样调用自己需要的函数,而官方也内置了一些常用的函数供大家调用. 比如今天我们说的截 ...
- Python 2.7 学习笔记 内置语句、函数、标准库
使用任何开发语言进行软件开发,都离不开语言提供的内置库(或Api),甚至说内置库的强大及使用是否方便都会影响大家对开发语言的选择. python语言,一样提供了很多内置的功能,可供开发时使用.主要有如 ...
随机推荐
- TP多条件查询
$stcount = M("Results_all")->alias('a') ->join("s_test_name as b on a.subject = ...
- vue key 的另外一个用法 过度
key也可以用于强制替换元素/组件而不是重复使用它.当你遇到如下场景时它可能会很有用: 完整地触发组件的生命周期钩子 触发过渡 例如: <transition> <span :key ...
- Action window Flags
Action window 主要字段使用 含义 target 值 作用 current 当前窗口 new 新窗口 inline 内联编辑 fullscreen 全屏 main 当前窗口的主动作 ...
- JS 的引用赋值与传值赋值
这个问题说大不大说小不小,如果你有幸踩了这个坑,一定会找这篇文章,哈哈~ 现说一下JS数字的类型:基本类型和引用类型 先看下下面两个栗子: var a = 30; var b = a; a = 20; ...
- Android防止过快点击造成多次事件
问题 onClick事件是Android开发中最常见的事件. 比方,一个submitButton.功能是点击之后会提交一个订单, 则一般代码例如以下,当中submitOrder()函数会跳转到下一页进 ...
- WinForm程序打包工具InnoSetup使用说明图文教程
WinForm程序打包工具InnoSetup使用说明图文教程 WinForm程序开发测试好了,如果将Debug/Release里面的文件发给客户使用,会让客户觉得你不够专业,但是使用VS自带的打包工具 ...
- 利用expload 分割字符串 变成数组
#admin_abc去掉下划线 =>>变成 array('admin','abc') $table_Name=explode('_', $table_Name);
- Python 时间格式化(转)
From:http://www.cnblogs.com/65702708/archive/2011/04/17/2018936.html http://www.wklken.me/posts/2015 ...
- CentOS Python 安装MySQL-python
一.安装mysql yum list | grep mysql >>yum install -y mysql-server mysql mysql-devel CentOS 7的yum源中 ...
- 在命令行上启用 64 位 Visual C++ 工具集
Visual C++ 包含可用于创建 apps 在 32 位上运行,64 位,或基于 ARM 的 windows 操作系统的编译器. 下面的列表描述了 cl.exe(Visual C++ 编译器)的各 ...