ES操作

2019-10-09  本文已影响0人  安全的小飞飞

从文章只供个人学习参考使用!!

1、创建索引
PUT  索引名称
image.png
2、给索引起别名
PUT 索引名称/_alias/别名
image.png

一个别名可以对应多个索引,一个索引也可以对应多个别名

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
image.png
上一篇 下一篇

猜你喜欢

热点阅读