原有2个索引,如下:
GET 4d326769-d11e-46d5-8e3e-2160e17bafa0_006ff42a-ad28-48e3-84ea-8ffcd9ca975e_v1/_search?pretty=true GET c12d69aa-bd45-4ced-bc09-eb7a025315ef_006ff42a-ad28-48e3-84ea-8ffcd9ca975e_v1/fixedindextype/_search?pretty=true
新增别名的语句如下:
POST /_aliases { "actions": [ { "add": { "index": "4d326769-d11e-46d5-8e3e-2160e17bafa0_006ff42a-ad28-48e3-84ea-8ffcd9ca975e_v1", "alias": "myFirstAliases" } }, { "add": { "index": "c12d69aa-bd45-4ced-bc09-eb7a025315ef_006ff42a-ad28-48e3-84ea-8ffcd9ca975e_v1", "alias": "myFirstAliases" } } ] }
使用别名查询的方法如下:
GET myFirstAliases/_search?pretty=true