ES 数据库常见命令

1. 创建索引

PUT test    //test 索引名称
返回结果:
{
"acknowledged": true, "shards_acknowledged": true, "index": "test" }

2. 查询索引设置

GET test/_settings?pretty
返回结果:
{
  "test": {
    "settings": {
      "index": {
        "creation_date": "1629217681883",
        "number_of_shards": "5",
        "number_of_replicas": "2",
        "uuid": "5p2S3xQ9QLGhtgoKc4A",
        "version": {
          "created": "6000099"
        },
        "provided_name": "test"
      }
    }
  }
}

 

3. 查询所有索引

GET _cat/indices?v
health status index                     uuid                   pri rep docs.count docs.deleted store.size pri.store.size
yellow open   test                      LL9Lbu0LTLKeJRb7Em4tiA   5   1          0            0      1.1kb          1.1kb

 

4. 设置副本数

PUT smartpen_pages_dots/_settings
{
  "number_of_replicas": 1
}

 

返回结果:
{
  "acknowledged": true
}

 

 

 

 

posted @ 2021-08-18 01:06  一样菜  阅读(324)  评论(0编辑  收藏  举报