设为首页 加入收藏

TOP

Elasticsearch?alias别名管理小结(一)
2019-09-17 16:02:06 】 浏览:43
Tags:Elasticsearch alias 别名 管理 小结

Elasticsearch alias别名管理小结

By:授客 QQ:1033553122 

 

建创测试数据 1

创建别名 2

移除别名 3

创建测试数据 4

批量操作 5

1. 5

2. 把多个索引添加到一个别名中 6

3. 使用通配符 8

 

测试环境:

Win elasticsearch-5.4.1

 

1. 别名管理

建创测试数据

PUT test1_index

 

POST test1_index/doctype/1

{

    "name":"shouke",

    "addr":"深圳"

}

 

POST test1_index/doctype/2

{

    "name":"shou ke",

    "addr":"深圳"

}

 

POST test1_index/doctype/_search

 

 

创建别名

POST /_aliases

{

   "actions": [

      {

         "add": {

            "index": "test1_index",

            "alias": "test1_index_alias"

         }

      }

   ]

}

 

说明:index 为要创建别名的“源索引”, alias 别名

 

搜索验证

POST /test1_index_alias/_search

 

Elasticsearch <wbr>alias别名管理小结 

 

移除别名

POST /_aliases

{

   "actions": [

      {

         "remove": {

            "index": "test1_index",

            "alias": "test1_index_alias"

         }

      }

   ]

}

 

验证

POST /test1_index_alias/_search

 

Elasticsearch <wbr>alias别名管理小结 

 

 

创建测试数据

PUT /test2_index

 

POST test2_index/doctype/1

{

    "name":"shouke",

    "addr":"福建"

}

 

POST test2_index/doctype/2

{

    "name":"shou ke",

    "addr":"福建"

}

 

POST /_aliases

{

   "actions": [

      {

         "add": {

            "index": "test1_index",

            "alias": "test_index_alias"

         }

      }

   ]

}

 

批量操作

1.

POST /_aliases

{

   "actions": [

      {

         "remove": {

            "index": "test1_index",

          &nb

首页 上一页 1 2 3 下一页 尾页 1/3/3
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇MySQL?横向表分区之RANGE分区小结 下一篇Can't create/write to file ..

最新文章

热门文章

Hot 文章

Python

C 语言

C++基础

大数据基础

linux编程基础

C/C++面试题目