Get index segments
- GET /{index}/_segments
- GET /_segments
Get low-level information about the Lucene segments in index shards. For data streams, the API returns information about the stream's backing indices.
Required privileges
- Index privileges monitor
Query parameters
-
allow_no_indicesboolean · default: true -
A setting that does two separate checks on the index expression. If
false, the request returns an error (1) if any wildcard expression (including_alland*) resolves to zero matching indices or (2) if the complete set of resolved indices, aliases or data streams is empty after all expressions are evaluated. Iftrue, index expressions that resolve to no indices are allowed and the request returns an empty result. -
expand_wildcardsunion oneOf · default: open -
Type of index that wildcard patterns can match. If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams. Supports comma-separated values, such as
open,hidden.Supported values include:
all: Match any data stream or index, including hidden ones.open: Match open, non-hidden indices. Also matches any non-hidden data stream.closed: Match closed, non-hidden indices. Also matches any non-hidden data stream. Data streams cannot be closed.hidden: Match hidden data streams and hidden indices. Must be combined withopen,closed, orboth.none: Wildcard expressions are not accepted.
-
Values:
allopenclosedhiddennone -
ignore_unavailableboolean · default: false -
If
false, the request returns an error if it targets a concrete (non-wildcarded) index, alias, or data stream that is missing, closed, or otherwise unavailable. Iftrue, unavailable concrete targets are silently ignored. -
include_auto_calibrationboolean · default: falseThe Elastic Stack includes Elastic's core products such as Elasticsearch, Kibana, Logstash, and Beats. Availability Planned We plan to add this functionality in a future Elastic Stack update. Subject to changes. Unless stated otherwise on the page, this functionality is available when your Elastic Stack is deployed on Elastic Cloud Hosted, Elastic Cloud Enterprise, Elastic Cloud on Kubernetes, and self-managed environments. This documentation corresponds to the latest patch available for each minor version. If you're not using the latest patch, check the release notes for changes. -
If
true, the response includes the auto-calibration information of each segment, for thedense_vectorfields that support auto-calibration. -
vector_formatsboolean · default: falseThe Elastic Stack includes Elastic's core products such as Elasticsearch, Kibana, Logstash, and Beats. Availability Generally available since 8.15 This functionality is generally available and ready for production usage. Unless stated otherwise on the page, this functionality is available when your Elastic Stack is deployed on Elastic Cloud Hosted, Elastic Cloud Enterprise, Elastic Cloud on Kubernetes, and self-managed environments. This documentation corresponds to the latest patch available for each minor version. If you're not using the latest patch, check the release notes for changes. -
If
true, the response includes the vector formats used by the fields of each segment, inattributes.
Response
-
indicesmap string to objectrequired -
<string>object -
shardsmap string to oneOfrequired -
<string>union oneOf -
segmentsmap string to objectrequired -
<string>object -
attributesmap string to string -
Contains information about whether high compression was enabled and per-field vector formats.
-
committedbooleanrequired -
If
true, the segment is synced to disk. Segments that are synced can survive a hard reboot. Iffalse, the data from uncommitted segments is also stored in the transaction log so that Elasticsearch is able to replay changes on the next start. -
compoundboolean -
If
true, Lucene merged all files from the segment into a single file to save file descriptors. -
deleted_docsnumberrequired -
The number of deleted documents as reported by Lucene, which may be higher or lower than the number of delete operations you have performed. This number excludes deletes that were performed recently and do not yet belong to a segment. Deleted documents are cleaned up by the automatic merge process if it makes sense to do so. Also, Elasticsearch creates extra deleted documents to internally track the recent history of operations on a shard.
-
generationnumberrequired -
Generation number, such as
0. Elasticsearch increments this generation number for each segment written then uses this number to derive the segment name. -
searchbooleanrequired -
If
true, the segment is searchable. Iffalse, the segment has most likely been written to disk but needs a refresh to be searchable. -
merge_idstring -
The ID of the merge the segment is part of. Only returned while the segment is being merged.
-
num_docsnumberrequired -
The number of documents as reported by Lucene. This excludes deleted documents and counts any nested documents separately from their parents. It also excludes documents which were indexed recently and do not yet belong to a segment.
-
auto_calibrationmap string to oneOfThe Elastic Stack includes Elastic's core products such as Elasticsearch, Kibana, Logstash, and Beats. Availability Planned We plan to add this functionality in a future Elastic Stack update. Subject to changes. Unless stated otherwise on the page, this functionality is available when your Elastic Stack is deployed on Elastic Cloud Hosted, Elastic Cloud Enterprise, Elastic Cloud on Kubernetes, and self-managed environments. This documentation corresponds to the latest patch available for each minor version. If you're not using the latest patch, check the release notes for changes. -
The auto-calibration information of the segment, per
dense_vectorfield that supports auto-calibration. Only returned wheninclude_auto_calibrationistrue. -
segmentsmap string to objectrequired -
<string>object -
attributesmap string to string -
Contains information about whether high compression was enabled and per-field vector formats.
-
committedbooleanrequired -
If
true, the segment is synced to disk. Segments that are synced can survive a hard reboot. Iffalse, the data from uncommitted segments is also stored in the transaction log so that Elasticsearch is able to replay changes on the next start. -
compoundboolean -
If
true, Lucene merged all files from the segment into a single file to save file descriptors. -
deleted_docsnumberrequired -
The number of deleted documents as reported by Lucene, which may be higher or lower than the number of delete operations you have performed. This number excludes deletes that were performed recently and do not yet belong to a segment. Deleted documents are cleaned up by the automatic merge process if it makes sense to do so. Also, Elasticsearch creates extra deleted documents to internally track the recent history of operations on a shard.
-
generationnumberrequired -
Generation number, such as
0. Elasticsearch increments this generation number for each segment written then uses this number to derive the segment name. -
searchbooleanrequired -
If
true, the segment is searchable. Iffalse, the segment has most likely been written to disk but needs a refresh to be searchable. -
merge_idstring -
The ID of the merge the segment is part of. Only returned while the segment is being merged.
-
num_docsnumberrequired -
The number of documents as reported by Lucene. This excludes deleted documents and counts any nested documents separately from their parents. It also excludes documents which were indexed recently and do not yet belong to a segment.
-
auto_calibrationmap string to oneOfThe Elastic Stack includes Elastic's core products such as Elasticsearch, Kibana, Logstash, and Beats. Availability Planned We plan to add this functionality in a future Elastic Stack update. Subject to changes. Unless stated otherwise on the page, this functionality is available when your Elastic Stack is deployed on Elastic Cloud Hosted, Elastic Cloud Enterprise, Elastic Cloud on Kubernetes, and self-managed environments. This documentation corresponds to the latest patch available for each minor version. If you're not using the latest patch, check the release notes for changes. -
The auto-calibration information of the segment, per
dense_vectorfield that supports auto-calibration. Only returned wheninclude_auto_calibrationistrue.
ShardsSegment[]