一、别名操作

1.查询某个index下的别名:
GET school/_alias/*
添加别名
POST _aliases
{
  "actions" : [{"add" : {"index" : "school" , "alias" : "in1"}}]
}

2.删除别名
POST /_aliases
{
    "actions": [
        {"remove": {"index": "school", "alias": "in1"}}
    ]
}
3.同时删除和添加别名(原子操作)
POST _aliases
{
  "actions" : [
      {
    
      "remove": {
         "index" : "wisdom_system_msg_cy" , "alias" : "wisdom_system_msg_merge"
      }
    },
    
    {
      "add" : {
        "index" : "wisdom_system_msg_new" , "alias" : "wisdom_system_msg_merge"
      }
    
  }

  ]
  
}

二、查询索引相关

1.查询指定索引数量

GET /wisdom_approve_msg/_count
{
  "query": {
    "match_all": {}
  }
}

2.查看所有索引

GET _cat/indices?v

3.查看指定索引开头的索引

查询s开头的索引
GET _cat/indices/s*?v
Logo

为开发者提供学习成长、分享交流、生态实践、资源工具等服务,帮助开发者快速成长。

更多推荐