当前位置:网站首页>The difference between searching forward index and inverted index
The difference between searching forward index and inverted index
2022-07-05 16:30:00 【Software engineering Xiao Shi】
One 、 What is a forward index? (forward index)?
in short , from key The process of querying entities , Using forward index .
for example , User table :
t_user(uid, name, passwd, age, sex)
from uid The process of querying the whole line , Is the forward index query .
Voice over : Time complexity can be thought of as O(1).
Two 、 What is inverted index (inverted index)?
Contrary to forward index , from item Inquire about key The process of , Use inverted index .
For web search , Inverted index can be understood as :
Map<item, list<url>>
It can quickly find the data structure of the web page containing the query word by the query word .
Voice over : Time complexity is also O(1).
for instance , Suppose there is 3 Pages :
url1 -> “ I love Beijing ”
url2 -> “ I love going home ”
url3 -> “ Home is beautiful ”
This is a Forward index :
Map<url, page_content>.
After the participle :
url1 -> { I , Love , Beijing }
url2 -> { I , Love , home }
url3 -> { home , happy }
This is a Forward index after segmentation :
Map<url, list<item>>.
Inverted index after word segmentation :
I -> {url1, url2}
Love -> {url1, url2}
Beijing -> {url1}
home -> {url2, url3}
happy -> {url3}
By key words item Quickly find the web page containing the query word Map<item, list<url>> Namely Inverted index .
Voice over : I see! , Word to url The process of , It's inverted index .
Forward index and inverted index are spider and build_index The system establishes a good data structure in advance , Why use these two data structures , Because it can be implemented quickly “ User web search ” demand .
Voice over , Business requirements determine architecture implementation , It's quick to find out .
边栏推荐
- List de duplication and count the number
- Win11提示无法安全下载软件怎么办?Win11无法安全下载软件
- list使用Stream流进行根据元素某属性数量相加
- scratch五彩糖葫芦 电子学会图形化编程scratch等级考试三级真题和答案解析2022年6月
- Cartoon: what is service fusing?
- 公司自用的国产API管理神器
- 用键盘输入一条命令
- Intel 13th generation Raptor Lake processor information exposure: more cores, larger cache
- Domestic API management artifact used by the company
- 一文带你吃透js处理树状结构数据的增删改查
猜你喜欢

Batch update in the project

2020-2022两周年创作纪念日

Subclasses and superclasses of abstract classes

Mistakes made when writing unit tests

Explain in detail the functions and underlying implementation logic of the groups sets statement in SQL

Win11如何给应用换图标?Win11给应用换图标的方法

ES6深入—ES6 Class 类

ES6深入—ES6 Generator 函数

Flet教程之 12 Stack 重叠组建图文混合 基础入门(教程含源码)

vulnhub-FirstBlood
随机推荐
Research and practice of super-resolution technology in the field of real-time audio and video
单商户 V4.4,初心未变,实力依旧!
迁移/home分区
《21天精通TypeScript-3》-安装搭建TypeScript开发环境.md
降本40%!Redis多租户集群的容器化实践
写单元测试的时候犯的错
vant tabbar遮挡内容的解决方式
普洛斯数据中心发布DC Brain系统,科技赋能智慧化运营管理
一些認知的思考
Obj resolves to a set
HiEngine:可媲美本地的云原生内存数据库引擎
一键安装脚本实现快速部署GrayLog Server 4.2.10单机版
Using graylog alarm function to realize the regular work reminder of nail group robots
Win11提示无法安全下载软件怎么办?Win11无法安全下载软件
Solve the Hanoi Tower problem [modified version]
ES6 drill down - Async functions and symbol types
《MongoDB入门教程》第04篇 MongoDB客户端
List uses stream flow to add according to the number of certain attributes of the element
超分辨率技术在实时音视频领域的研究与实践
sql中set标签的使用