Segments and merging policies

A Lucene index is composed of smaller chunks that are called segments. In other words, a segment is a section of an index. Each segment is a fully independent index. A new segment can be created when a new document is added or, in the automatic refresh process, it occurs every second by default in Elasticsearch. Each segment consumes system resources (that is, memory, CPU cycles, and so on) and, besides, every segment is checked at search time. This means that if there are more segments, they will be searched and there will be more memory usage. For these reasons, increasing the number of segments is a problem. Small segments are copied to the bigger segment to solve this problem, and the copied segments are deleted ...

Get Elasticsearch Indexing now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.