elasticsearch的别名alias添加与设置语法


添加某个index的别名语法如下

POST /_aliases
{
    "actions": [
        { "add":    { "index": "us_tm_ncl_v1", "alias": "us_tm_ncl" }}
    ]
}

如果要将该别名指向别的index,则需要先删除别名指向,重新添加指向

POST /_aliases
{
    "actions": [
        { "remove": { "index": "us_tm_ncl_v1", "alias": "us_tm_ncl" }},
        { "add":    { "index": "us_tm_ncl_v2", "alias": "us_tm_ncl" }}
    ]
}

声明:梨木乔の技术栈|版权所有,违者必究|如未注明,均为原创|本网站采用BY-NC-SA协议进行授权

转载:转载请注明原文链接 - elasticsearch的别名alias添加与设置语法


梨木乔の技术栈