Open Index API
open index API 작업은 닫힌(closed) 인덱스를 열어서, 그 인덱스 안에 데이터를 추가하거나 검색할 수 있게 해줘요. 닫힌 상태의 인덱스는 자원을 아끼기 위해 잠시 비활성화된 것이므로, 다시 사용하려면 이 API로 열어 주면 돼요. 이 기능은 OpenSearch 1.0에서 처음 소개되었어요.
출처: OpenSearch 문서
본문
엔드포인트
POST /{index}/_open
경로 매개변수
| Parameter | Type | Description | | | String | The index to open. Can be a comma-separated list of multiple index names. Use _all or * to open all indexes. |
쿼리 매개변수
모든 매개변수는 선택 사항이에요.
| Parameter | Type | Description | | allow_no_indices | Boolean | Whether to ignore wildcards that don’t match any indexes. Default is true. | | expand_wildcards | String | Expands wildcard expressions to different indexes. Combine multiple values with commas. Available values are all (match all indexes), open (match open indexes), closed (match closed indexes), hidden (match hidden indexes), and none (do not accept wildcard expressions). Default is open. | | ignore_unavailable | Boolean | If true, OpenSearch does not search for missing or closed indexes. Default is false. | | wait_for_active_shards | String | Specifies the number of active shards that must be available before OpenSearch processes the request. Default is 1 (only the primary shard). Set to all or a positive integer. Values greater than 1 require replicas. For example, if you specify a value of 3, the index must have two replicas distributed across two additional nodes for the request to succeed. | | cluster_manager_timeout | Time | How long to wait for a connection to the cluster manager node. Default is 30s. | | timeout | Time | How long to wait for a response from the cluster. Default is 30s. | | wait_for_completion | Boolean | When set to false, the request returns immediately instead of after the operation is finished. To monitor the operation status, use the Tasks API with the task ID returned by the request. Default is true. | | task_execution_timeout | Time | The explicit task execution timeout. Only useful when wait_for_completion is set to false. Default is 1h. |
예제 요청
POST /sample-index/_open
response = client.indices.open(
index = "sample-index"
)
예제 응답
{
"acknowledged": true,
"shards_acknowledged": true
}
필요한 권한
Security 플러그인을 사용한다면 적절한 권한이 있는지 확인해 주세요: indices:admin/open.
더 알아보기 (Learn more)
인덱스 상태 관리에 대해 더 알고 싶다면 원문 OpenSearch 문서를 확인해 주세요.