倒排索引(Inverted Index)
 
倒排索引是一种索引结构,它存储了单词与单词自身在一个或多个文档中所在位置之间的映射。
倒排索引通常利用关联数组实现。它拥有两种表现形式:

inverted file index,其表现形式为 {词项,词项所在文档的ID}
full inverted index,其表现形式为 {词项,(词项所在文档的ID,在具体文档中的位置)}

具体实例,假设有三个文档:

D0 = "it is what it is"
    D1 = "what is it"
    D2 = "it is a banana"

那么,采用inverted file index方式,结果是:
"a": {2}
"banana": {2}
"is": {0, 1, 2}
"it": {0, 1, 2}
"what": {0, 1}

采用full inverted index方式,结果是:

"a":      {(2, 2)}
"banana": {(2, 3)}
"is":     {(0, 1), (0, 4), (1, 1), (2, 1)}
"it":     {(0, 0), (0, 3), (1, 2), (2, 0)}
"what":   {(0, 2), (1, 0)}

倒排索引(Inverted Index)的更多相关文章

  1. 正排索引(forward index)与倒排索引(inverted index)

    正常的索引一般是指关系型数据库里的索引. 把不同的数据存放到不同的字段中.如果要实现baidu或google那种搜索,就需要与一条记录的多个字段进行比对,需要 全表扫描,如果数据量比较大的话,性能就很 ...

  2. 正排索引(forward index)与倒排索引(inverted index) (转)

    一.正排索引(前向索引) 正排索引也称为"前向索引".它是创建倒排索引的基础,具有以下字段. (1)LocalId字段(表中简称"Lid"):表示一个文档的局部 ...

  3. [IR] Inverted Index & Boolean retrieval

    教材:<信息检索导论> 倒排索引 How to build Inverted Index? 1. Token sequence. 2. Sort by terms. 3. Dictiona ...

  4. [Search Engine] Compression in Inverted Index

    最近在学一些搜索引擎的内容,感觉挺费劲,所以就用博客当做自己的笔记,遇到一些需要整理的部分,就在这里整理一下. 今天的内容是对inverted index进行压缩.核心思想,用我自己的话来总结,就是“ ...

  5. Fielddata is disabled on text fields by default. Set fielddata=true on [gender] in order to load fielddata in memory by uninverting the inverted index. Note that this can however use significant memor

    ES进行如下聚合操作时,会报如题所示错误: ➜ Downloads curl -XPOST 'localhost:9200/bank/_search?pretty' -d ' { "size ...

  6. 反向索引(Inverted Index)

    转自:http://zhangyu8374.iteye.com/blog/86307 反向索引是一种索引结构,它存储了单词与单词自身在一个或多个文档中所在位置之间的映射.反向索引通常利用关联数组实现. ...

  7. Elasticsearch 报错:Fielddata is disabled on text fields by default. Set `fielddata=true` on [`your_field_name`] in order to load fielddata in memory by uninverting the inverted index.

    Elasticsearch 报错: Fielddata is disabled on text fields by default. Set `fielddata=true` on [`your_fi ...

  8. Elasticsearch:inverted index,doc_values及source

    以后会用到的相关知识:索引中某些字段禁止搜索,排序等操作 当我们学习Elasticsearch时,经常会遇到如下的几个概念: Reverted index doc_values source? 这个几 ...

  9. 504. Inverted Index (Map Reduce) lintcode

    https://www.lintcode.com/problem/inverted-index-map-reduce/description -- decription of the map redu ...

随机推荐

  1. UVA 818 Cutting Chains(状压 + 暴搜)题解

    题意:有1~n个小环,他们中的有些互相扣在一起,问你至少切开几个能把这写小环串成一条链 思路:还是太菜了,题目给的n<=15,显然可以暴力解决. 用二进制表示每个环切还是不切,然后搜索所有情况. ...

  2. Directional RNA-seq data -which parameters to choose?

    Directional RNA-seq data -which parameters to choose? REF: https://chipster.csc.fi/manual/library-ty ...

  3. 题解——洛谷P2781 传教(线段树)

    可以说是数据结构学傻了的典型案例了 昨天跳到这题上 然后思考了一下 噫!好!线段树裸题 然后打完板子,发现\(  n \le 10^9 \) 显然线段树直接做不太行 然后这题又只有普及的难度 然后我就 ...

  4. vue项目从引入vue.js 改为使用vue-cil (webpack)时修改的一些内容

    在元素属性中不要写js关键字,会报使用关键字的错如@click='if(){}else{}', if-else 语句可以使用三元表达式或短路运算符来实现 v-for 不写:key  会有警告 ,使用: ...

  5. (转载)WinformGDI+入门级实例——扫雷游戏(附源码)

    本文将作为一个入门级的.结合源码的文章,旨在为刚刚接触GDI+编程或对相关知识感兴趣的读者做一个入门讲解.游戏尚且未完善,但基本功能都有,完整源码在文章结尾的附件中. 整体思路: 扫雷的游戏界面让我从 ...

  6. 剥开比原看代码09:通过dashboard创建密钥时,前端的数据是如何传到后端的?

    作者:freewind 比原项目仓库: Github地址:https://github.com/Bytom/bytom Gitee地址:https://gitee.com/BytomBlockchai ...

  7. 【.Net】在windows server 2016 和Windows10这些server上安装.net fw3.5

    一般就是打开server manager. 一直next到add feature 讲net3.5勾选 发现需要指定一个路径是什么 source\sxs之类的 下载microsoft-windows-n ...

  8. 从命令行git转到Tortoise

    阅读前请注意:本文先学命令行git的,但过不久遇到乱码问题久久不能解决,最后转向tgit. 2016-29 安装 next 下一步 设置目录 勾选需要的项: Additional icons是关于图标 ...

  9. 4、iptables扩展匹配及网络防火墙功能

    关于centos7   firewalld    http://www.ibm.com/developerworks/cn/linux/1507_caojh/index.html 如何保存及重载规则: ...

  10. python Exception中的raise、assert

    使用raise抛出异常 当程序出现错误,python会自动引发异常,也可以通过raise显式地引发异常.一旦执行了raise语句,raise后面的语句将不能执行. 演示raise用法. try: s ...