cat segments APIedit

Returns low-level information about the Lucene segments in index shards, similar to the indices segments API.


GET /_cat/segments/{index}

Path parametersedit

(Optional, string) Comma-separated list or wildcard expression of index names used to limit the request.

Query parametersedit

(Optional, byte size units) Unit used to display byte values.
(Optional, string) Short version of the HTTP accept header. Valid values include JSON, YAML, etc.

(Optional, string) Comma-separated list of column names to display.

If you do not specify which columns to include, the API returns the default columns in the order listed below. If you explicitly specify one or more columns, it only returns the specified columns.

Valid columns are:

index, i, idx
(Default) Name of the index, such as twitter.
shard, s, sh
(Default) Name of the shard.
prirep, p, pr, primaryOrReplica
(Default) Shard type. Returned values are primary or replica.
(Default) IP address of the segment’s shard, such as
(Default) Name of the segment, such as _0. The segment name is derived from the segment generation and used internally to create file names in the directory of the shard.
(Default) Generation number, such as 0. Elasticsearch increments this generation number for each segment written. Elasticsearch then uses this number to derive the segment name.
(Default) Number of non-deleted documents in the segment, such as 25. This number is based on Lucene documents and may include documents from nested fields.
(Default) Number of deleted documents in the segment, such as 0. This number is based on Lucene documents. Elasticsearch reclaims the disk space of deleted Lucene documents when a segment is merged.
(Default) Disk space used by the segment, such as 50kb.
(Default) Bytes of segment data stored in memory for efficient search, such as 1264.

(Default) If true, the segment is committed to disk. Segments committed to disk would survive a hard reboot.

If false, the data from uncommitted segments is also stored in the transaction log. Elasticsearch replays those changes on the next start.


(Default) If true, the segment is searchable.

If false, likely means the segment is written to disk but has not been refreshed.

(Default) Version of Lucene used to write the segment.
(Default) If true, the segment is stored in a compound file. This means Lucene merged all files from the segment in a single file to save file descriptors.
ID of the node, such as k0zy.
(Optional, boolean) If true, the response returns help information. Defaults to false.
(Optional, string) Comma-separated list of column names or column aliases used to sort the response.
(Optional, boolean) If true, the response includes column headings. Defaults to false.


GET /_cat/segments?v

The API returns the following response:

index shard prirep ip        segment generation docs.count docs.deleted size size.memory committed searchable version compound
test  0     p _0               0          1            0  3kb        2042 false     true       8.1.0   true
test1 0     p _0               0          1            0  3kb        2042 false     true       8.1.0   true