常用命令
1.查看index
curl 'http://ip地址:9200/data_**'
2.刪除index
curl -XDELETE 'http://ip地址:9200/data_**'
3.新建index
打開postman失暴,根據(jù)自己需求新建index
es
4.如果原index中數(shù)據(jù)較多
先創(chuàng)建一個(gè)新的index邀层,然后將舊數(shù)據(jù)同步到新index中
POST data_new
{
"source": {
"index": "data_old"
},
"dest": {
"index": "data_new"
}
}
5.刪除原index
DELETE data_old
6.設(shè)置別名
POST /_aliases
{
"actions": [
{"add": {"index": "data_new", "alias": "data_old"}}
]
}
強(qiáng)迫癥患者可以在刪除index后,再創(chuàng)建一個(gè)新的名稱一樣的index椅挣,重復(fù)3-5步头岔,然后刪除data_new