For multiterm queries, Lucene takes the Boolean modelTF/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)    

score(q,d) is the relevance score of document d for query q.

queryNorm(q) is the query normalization factor (new).

coord(q,d) is the coordination factor (new).

 

The sum of the weights for each term t in the query q for document d.

tf(t in d) is the term frequency for term t in document d.

idf(t) is the inverse document frequency for term t.

t.getBoost() is the boost that has been applied to the query (new).

norm(t,d) is the field-length norm, combined with the index-time field-level boost, if any. (new). 官方不推荐用index-time find level

You should recognize scoretf, and idf. The queryNormcoordt.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 sumOfSquaredWeights is calculated by adding together the IDF of each term in the query, squared.

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内置的评分函数的更多相关文章

  1. JMeter 内置日期(时间)函数总结

    JMeter 内置日期(时间)函数总结   by:授客 QQ:1033553122 1. 测试环境 apache-jmeter-3.3 下载地址: http://jmeter.apache.org/c ...

  2. Hive 文件格式 & Hive操作(外部表、内部表、区、桶、视图、索引、join用法、内置操作符与函数、复合类型、用户自定义函数UDF、查询优化和权限控制)

    本博文的主要内容如下: Hive文件存储格式 Hive 操作之表操作:创建外.内部表 Hive操作之表操作:表查询 Hive操作之表操作:数据加载 Hive操作之表操作:插入单表.插入多表 Hive语 ...

  3. python 练习题:请利用Python内置的hex()函数把一个整数转换成十六进制表示的字符串

    # -*- coding: utf-8 -*- # 请利用Python内置的hex()函数把一个整数转换成十六进制表示的字符串 n1 = 255 n2 = 1000 print(hex(n1)) pr ...

  4. python(内置高阶函数)

    1.高阶函数介绍: 一个函数可以作为参数传给另外一个函数,或者一个函数的返回值为另外一个函数(若返回值为该函数本身,则为递归),如果满足其一,则为高阶函数. 常见的高阶函数:map().sorted( ...

  5. Python中匿名函数与内置高阶函数详解

    大家好,从今天起早起Python将持续更新由小甜同学从 初学者的角度 学习Python的笔记,其特点就是全文大多由 新手易理解 的 代码与注释及动态演示 .刚入门的读者千万不要错过! 很多人学习pyt ...

  6. classmethod、staticclassmethod内置装饰器函数

    # method 英文是方法的意思 # classmethod 类方法 # 当一个类中的方法中只涉及操作类的静态属性时,此时在逻辑上,我们想要直接通过类名就可以调用这个方法去修改类的静态属性,此时可以 ...

  7. property内置装饰器函数和@name.setter、@name.deleter

    # property # 内置装饰器函数 只在面向对象中使用 # 装饰后效果:将类的方法伪装成属性 # 被property装饰后的方法,不能带除了self外的任何参数 from math import ...

  8. Thinkphp内置截取字符串函数

    Thinkphp内置了一个可以媲美smarty的模板引擎,给我们带来了很大的方便.调用函数也一样,可以和smarty一样调用自己需要的函数,而官方也内置了一些常用的函数供大家调用. 比如今天我们说的截 ...

  9. Python 2.7 学习笔记 内置语句、函数、标准库

    使用任何开发语言进行软件开发,都离不开语言提供的内置库(或Api),甚至说内置库的强大及使用是否方便都会影响大家对开发语言的选择. python语言,一样提供了很多内置的功能,可供开发时使用.主要有如 ...

随机推荐

  1. vue2.0 仿手机新闻站(二)项目结构搭建 及 路由配置

    1.项目结构 $ vue init webpack-simple news $ npm install vuex vue-router axios style-loader css-loader -D ...

  2. ie 浏览器无法保存cookie,且与域名包括了下划线(_)有关系的问题

    <span style="font-family: Arial, Helvetica, sans-serif; background-color: rgb(255, 255, 255) ...

  3. Nook 2 Root

        最后我还是忍不住root了它,用了差一点够一个月 1.备份2.root 3.装软件=====================================================1. ...

  4. Oracle 在Drop表时的Cascade Constraints

    http://hi.baidu.com/rebooo/item/12b500b130022bf263388e69假设A为主表(既含有某一主键的表),B为从表(即引用了A的主键作为外键).则当删除A表时 ...

  5. View的滚动原理简单解析

    一直对View的滚动了解的不深,说明确了吧也能说出个所以然来,所以我就花了点时间做了一个小小的总结,言归正传,view的滑动分为下面三种: 1)View本身不滚动,指滚动View的内容,这也是View ...

  6. 转:3.3V和5V电平双向转换——NMOS管

    分简单,仅由3个电阻加一个MOS管构成,电路图如下: 此电路来自于飞利浦的一篇设计指导文档,是I2C总线官方推荐使用的电平转换电路.在实际使用过程中,需要尤其注意NMOS管的选型以及上拉电阻阻值的选取 ...

  7. HTML5 2D平台游戏开发#3冲刺

    断断续续地把Demo又写了一阵,终于把角色的冲刺动作完成了.冲刺的作用是使角色能够快速移动,闪避攻击或障碍.其完成效果如下: 首先,仍需要一些变量来表示角色的冲刺状态: //标识角色是否处于冲刺中 v ...

  8. 【转】2018年EI收录中文期刊目录

    序号 中文刊名 收录情况 1 声学学报 保持收录 2 航空学报 保持收录 3 兵工学报 保持收录 4 自动化学报 保持收录 5 电子学报 保持收录 6 太阳能学报 保持收录 7 测绘学报 保持收录 8 ...

  9. Vim 打开文件同时定位到某一行

    在linux下,当后台某一行报警出错后,想用vim打开文件同时定位到某一行, Vim +某一行 filename 即可.

  10. go with go

    1, vim 安装vim-go 打造GOLANG 专用IDE golang和vim-go安装配置 2, 阅读图书 <Go语言实战> William Kennedy等, 李兆海 译 3,在线 ...