当前位置:网站首页>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 .
边栏推荐
- Mistakes made when writing unit tests
- 服务器的数据库连不上了2003,10060“Unknown error“【服务已起、防火墙已关、端口已开、netlent 端口不通】
- Dataarts studio data architecture - Introduction to data standards
- Some cognitive thinking
- Exception com alibaba. fastjson. JSONException: not match : - =
- 普洛斯数据中心发布DC Brain系统,科技赋能智慧化运营管理
- 清晰还原31年前现场,火山引擎超清修复Beyond经典演唱会
- 公司自用的国产API管理神器
- 2020-2022 two-year anniversary of creation
- ES6 deep - ES6 class class
猜你喜欢
Parameter type setting error during batch update in project SQL
Win11如何给应用换图标?Win11给应用换图标的方法
服务器的数据库连不上了2003,10060“Unknown error“【服务已起、防火墙已关、端口已开、netlent 端口不通】
Pits encountered in the use of boolean type in development
obj集合转为实体集合
视觉体验全面升级,豪威集团与英特尔Evo 3.0共同加速PC产业变革
Explain in detail the functions and underlying implementation logic of the groups sets statement in SQL
Win11提示无法安全下载软件怎么办?Win11无法安全下载软件
开发中Boolean类型使用遇到的坑
效果编辑器新版上线!3D渲染、加标注、设置动画,这次一个编辑器就够了
随机推荐
vant popup+其他组件的组合使用,及避坑指南
PSPNet | 语义分割及场景分析
Is it safe for Guotai Junan to open an account online
Flet教程之 11 Row组件在水平数组中显示其子项的控件 基础入门(教程含源码)
详解SQL中Groupings Sets 语句的功能和底层实现逻辑
后台系统发送验证码功能
漫画:什么是蓝绿部署?
ES6深入—async 函数 与 Symbol 类型
How can programmers improve their situation?
Research and development efficiency measurement index composition and efficiency measurement methodology
Cartoon: what is the eight queens problem?
Replknet: it's not that large convolution is bad, but that convolution is not large enough. 31x31 convolution. Let's have a look at | CVPR 2022
阿掌的怀念
[graduation season] as a sophomore majoring in planning, I have something to say
yarn 常用命令
Data Lake (XIV): spark and iceberg integrated query operation
Explain in detail the functions and underlying implementation logic of the groups sets statement in SQL
抽象类中子类与父类
obj集合转为实体集合
效果编辑器新版上线!3D渲染、加标注、设置动画,这次一个编辑器就够了