1. 原来索引
PUT my_index
{
"mappings": {
"_doc": {
"properties": {
"create_date": {
"type": "date",
"format": "yyyy-MM-dd ||yyyy/MM/dd"
}
}
}
}
}
2.创建新索引
PUT my_index2
{
"mappings": {
"_doc": {
"properties": {
"create_date": {
"type": "text"
}
}
}
}
}
3.同步数据
POST _reindex
{
"source": {
"index": "my_index"
},
"dest": {
"index": "my_index2"
}
}
4.
删除原索引
DELETE my_index
5.
设置别名
POST /_aliases
{
"actions": [
{"add": {"index": "my_index2", "alias": "my_index"}}
]
}
阅读(2562) | 评论(0) | 转发(0) |