ES倒排索引

ES的倒排索引结构:Mysql是B+树,那么倒排索引是如何组织的?

term dictionary: es对所有的term进行了排序,这样可以二分查找。但是不可能把所有的term-dictionary放在内存中。 所以term dictionary之上有一个 term index, term index是一个字典树的结构。但是term index也不会包含所有的term,只包含一些 term的前缀,通过term-index快速定位到term dictionary的某个offset。

Lucene还会用FST对dictionary进行压缩

Written on March 3, 2022