elasticsearch 索引别名

查看别名get /xx-index/_aliases
1对1 添加

post /_aliases
{
"actions": [
{"add" : { "index" : "xx-2018-08-08", "alias": "xxxxxx"} }
]
}

1对1 移除

post /_aliases
{
"actions": [
{"remove" : { "index" : "xx-2018-08-08", "alias": "xxxxxx"} }
]
}

多对1(同样支持通配符)

post /_aliases
{
"actions": [
{"add" : { "indices" : ["xx-2018-08-08","xx-2018-08-09"], "alias": "xxxxxx"} }
]
}

移除跟1对1移除一样
这里有个注意点 搜索文档的时候,多对1无法搜索会报错

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容