ElasticSearch28:初识搜索引擎_倒排索引核心原理快速揭秘

1.认识倒排索引

有两段话:

doc1: I really liked my small dogs ,and I think my mom also liked them.

doc2:He never liked any dogs,so I hope that my mom will not expect me to liked him.


word        doc1            doc2

I               *                     *

really      *                   

liked       *                      *

my          *                      *

small      *                   

and           *                        

think         *                  

mom        *                   *  

also          *         

them        *              

He                                 *

never                            *

any                                *

so                                *

hope                            *

that                               *

will                              *

not                               *

except                         *

me                             *

him                           *

上述过程,就是倒排索引建立的一个过程。

搜索:mother like little dog 不可能有任何结果,但是这个绝对不是我们想要的结果。

mother和mom:同义词

like和liked:时态

little和small:同义词

dog和dogs:单复数

其实并没有很大的区别



2.normalization,建立倒排索引的时候,会执行一个操作,也就是说对拆分出的各个单词进行相应的处理,以提升后面搜索的时候能够搜索到相关联的文档的概率。

就是进行了同义词的转换,时态词的转换,单复数的转化等。

mom->mother

liked->like

small->little

dogs->dog


重新建立倒排索引,加入normalization,再次使用mother like little dog搜索,就可以查找到了。

建立倒排索引以及normalization 的过程

word        doc1            doc2

I               *                     *

really      *                   

liked       *                      *                       liked ->like

my          *                      *

small      *                                            small->little

dogs         *                  *                        dogs->dog

and           *                        

think         *                  

mom        *                   *                        mom->mother

also          *         

them        *              

He                                 *

never                            *

any                                *

so                                *

hope                            *

that                               *

will                              *

not                               *

except                         *

me                             *

him                           *


这样,就可以艘搜索到doc1,doc2













 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值