当前位置:网站首页>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 .
边栏推荐
- HiEngine:可媲美本地的云原生内存数据库引擎
- Obj resolves to a set
- Flet教程之 11 Row组件在水平数组中显示其子项的控件 基础入门(教程含源码)
- "21 days proficient in typescript-3" - install and build a typescript development environment md
- Convert obj set to entity set
- 公司自用的国产API管理神器
- 2020-2022 two-year anniversary of creation
- 英特尔第13代Raptor Lake处理器信息曝光:更多核心 更大缓存
- [vulnerability warning] cve-2022-26134 conflict Remote Code Execution Vulnerability POC verification and repair process
- Cheer yourself up
猜你喜欢

vant tabbar遮挡内容的解决方式

数据湖(十四):Spark与Iceberg整合查询操作

用键盘输入一条命令

RLock锁的使用

清晰还原31年前现场,火山引擎超清修复Beyond经典演唱会

单商户 V4.4,初心未变,实力依旧!

视觉体验全面升级,豪威集团与英特尔Evo 3.0共同加速PC产业变革

Coding devsecops helps financial enterprises run out of digital acceleration

Background system sending verification code function

Five common negotiation strategies of consulting companies and how to safeguard their own interests
随机推荐
Cartoon: what is service fusing?
Spring Festival Limited "forget trouble in the year of the ox" gift bag waiting for you to pick it up~
【毕业季】作为一名大二计科在校生,我有话想说
Domestic API management artifact used by the company
一键安装脚本实现快速部署GrayLog Server 4.2.10单机版
Seaborn绘制11个柱状图
Dare not buy thinking
10 minutes to help you get ZABBIX monitoring platform alarm pushed to nail group
抽象类中子类与父类
Flet教程之 09 NavigationRail 基础入门(教程含源码)
ES6深入—ES6 Generator 函数
公司自用的国产API管理神器
sql中查询最近一条记录
Cartoon: what is blue-green deployment?
Explain in detail the functions and underlying implementation logic of the groups sets statement in SQL
The list set is summed up according to a certain attribute of the object, the maximum value, etc
Intelligent metal detector based on openharmony
Record a 'very strange' troubleshooting process of cloud security group rules
不敢买的思考
给自己打打气