从文章只供个人学习参考使用!!
1、创建索引
PUT 索引名称

2、给索引起别名
PUT 索引名称/_alias/别名

一个别名可以对应多个索引,一个索引也可以对应多个别名
3、查询别名
GET /*/_alias/别名 //查某个别名映射的所有index
GET /索引/_alias/* //查询某个index拥有的别名
4、切换删除别名
POST /_aliases
{
"actions": [
{ "remove": { "index": "my_index_v1", "alias": "my_index" }},
{ "add": { "index": "my_index_v2", "alias": "my_index" }}
]
}
5、创建类型
PUT 索引名称/类型/_mapping

网友评论