凡事都在事上磨,这样才能精进,成长进步提高! ------ 博客园首页

es 修改 mapping 字段类型

es 修改 mapping 字段类型
一、原索引
PUT /my_index
{
"mappings": {
"_doc": {
"properties": {
"create_date": {
"type": "date",
"format": "yyyy-MM-dd ||yyyy/MM/dd"
}
}
}
}
}

二、创建新索引
PUT /my_index2
{
"mappings": {
"_doc": {
"properties": {
"create_date": {
"type": "text"

}
}
}
}
}

三、同步数据
POST /_reindex
{
"source": {
"index": "my_index",

"size": 5000

},
"dest": {
"index": "my_index2"
}
}

四、删除原索引
DELETE /my_index

五、设置别名
POST /_aliases
{
"actions": [
{"add": {"index": "my_index2", "alias": "my_index"}}
]
}

posted @   追风fc  阅读(5059)  评论(0编辑  收藏  举报
编辑推荐:
· [.NET]调用本地 Deepseek 模型
· 一个费力不讨好的项目,让我损失了近一半的绩效!
· .NET Core 托管堆内存泄露/CPU异常的常见思路
· PostgreSQL 和 SQL Server 在统计信息维护中的关键差异
· C++代码改造为UTF-8编码问题的总结
阅读排行:
· 【.NET】调用本地 Deepseek 模型
· CSnakes vs Python.NET:高效嵌入与灵活互通的跨语言方案对比
· Plotly.NET 一个为 .NET 打造的强大开源交互式图表库
· DeepSeek “源神”启动!「GitHub 热点速览」
· 上周热点回顾(2.17-2.23)
点击右上角即可分享
微信分享提示