ElasticSearch之Close index API

发布时间 2023-12-02 15:58:26作者: jackieathome

关闭指定的索引。

索引关闭之后:

  • 停止对读、写操作的响应。
  • 停止检索操作的响应。
  • 在索引关闭前,允许执行的操作,关闭之后均不允许执行。
  • ElasticSearch取消对索引的相关维护操作,包含内存中的数据结构,以及保存在存储中的数据。
  • 占用的存储空间,并不会主动释放。ElasticSearch不会删除已关闭的索引的数据文件。

命令样例如下:

curl -X POST "https://localhost:9200/testindex_003/_close?pretty" --cacert $ES_HOME/config/certs/http_ca.crt -u "elastic:ohCxPH=QBE+s5=*lo7F9"

执行结果的样例,如下:

{
  "acknowledged": true,
  "shards_acknowledged": true,
  "indices": {
    "my-index-000001": {
      "closed": true
    }
  }
}

相关资料