1.概述
1.1 Segment是什么?
每个分片包含多个
segment(段),每一个segment都是一个倒排索引
在查询的时,会把所有的segment查询结果汇总归并后最为最终的分片查询结果返回
-
segment是不可变的,物理上你并不能从中删除信息,所以在删除文档的时候,是在文档上面打上一个删除的标记,然后在执行段合并的时候,进行删除
-
索引segment段的
个数越多
,搜索性能越低且消耗内存更多
2.段合并
Force Merge
The force merge API allows to force merging of one or more indices through an API. The merge relates to the number of segments a Lucene index holds within each shard. The force merge operation allows to reduce the numbe