CAT Segments API
cat segments 연산은 각 인덱스에 대한 Lucene 세그먼트 단위 정보를 나열해 줘요.
출처: OpenSearch 문서
본문
Endpoints
GET /_cat/segments
GET /_cat/segments/{index}
Query parameters
다음 표는 사용 가능한 쿼리 파라미터를 보여줘요. 모든 쿼리 파라미터는 선택사항이에요.
| Parameter | Data type | Description | Default | | bytes | String | The units used to display byte values. Valid values are: b, kb, k, mb, m, gb, g, tb, t, pb, and p. | N/A | | cluster_manager_timeout | String | The amount of time allowed to establish a connection to the cluster manager node. | N/A | | format | String | A short version of the Accept header, such as json or yaml. | N/A | | h | List | A comma-separated list of column names to display. | N/A | | help | Boolean | Returns help information. | false | | s | List | A comma-separated list of column names or column aliases to sort by. | N/A | | v | Boolean | Enables verbose mode, which displays column headers. | false |
Example requests
REST Python
GET /_cat/segments?v
Copy Copy as cURL
response = client.cat.segments(
params = { "v": "true" }
)
Copy 특정 인덱스의 세그먼트 정보만 보려면 쿼리 뒤에 인덱스 이름을 추가하면 돼요.
?v --> REST Python
GET /_cat/segments/?v
Copy Copy as cURL
response = client.cat.segments(
index = "",
params = { "v": "true" }
)
Copy 둘 이상의 인덱스 정보를 가져오려면 인덱스 이름을 쉼표로 구분하면 돼요.
REST Python
GET /_cat/segments/index1,index2,index3
Copy Copy as cURL
response = client.cat.segments(
index = "index1,index2,index3"
)
Copy
Example response
index | shard | prirep | ip | segment | generation | docs.count | docs.deleted | size | size.memory | committed | searchable | version | compound
movies | 0 | p | 172.18.0.4 | _0 | 0 | 1 | 0 | 3.5kb | 1364 | true | true | 8.7.0 | true
movies | 0 | r | 172.18.0.3 | _0 | 0 | 1 | 0 | 3.5kb | 1364 | true | true | 8.7.0 | true
Limiting the response size
반환되는 인덱스의 수를 제한하려면 cat.segments.response.limit.number_of_indices 설정을 구성하세요. 자세한 내용은 Cluster-level CAT response limit settings 문서를 참고하세요.
Required permissions
Security 플러그인을 사용한다면 적절한 권한(indices:monitor/segments)을 가지고 있는지 확인하세요.