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無法搜索會報錯



作者:續哥兒
鏈接:https://www.jianshu.com/p/bba4acc0ac57
來源:簡書
著作權歸作者所有。商業轉載請聯繫作者獲得授權,非商業轉載請註明出處。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章