当前位置:网站首页>es创建新的索引库并拷贝旧的索引库 实践亲测有效!
es创建新的索引库并拷贝旧的索引库 实践亲测有效!
2020-11-06 21:40:00 【会开车的架构师】
前言:项目中遇到索引库字段mapping映射类型不匹配的问题,需要修改mapping映射类型,于是就考虑删掉旧的mappings重新设计mappings字段类型再拷贝数据!
第一步、先看下旧的索引库的 settings、mapping结构
GET /intpolicy/_mapping
GET /intpolicy/_settings?pretty
第二步、看下旧的索引库数据量用来拷贝之后做数据量对比
GET /intpolicy/_search
第三步、创建新的索引库 注意settings、mapping结构不要拷贝错误
PUT intpolicy?include_type_name=false
{
"settings" : {
"index" : {
"number_of_shards" : "1",
"provided_name" : "intpolicy",
"creation_date" : "1578638080477",
"analysis" : {
"analyzer" : {
"numanalyzer" : {
"pattern" : "|",
"type" : "pattern"
}
}
},
"number_of_replicas" : "0",
"uuid" : "cmouqXBLQiyFAJ5BNii8nw",
"version" : {
"created" : "6080599"
}
}
},
"mappings" : {
"_doc" : {
"properties" : {
"advanceTicketLatest" : {
"type" : "short"
},
"advantageType" : {
"type" : "keyword"
},
"arr" : {
"type" : "text"
}
}
}
}
}
最后一步 将旧的索引库数据拷贝到新的索引库中
POST _reindex
{
"source": {
"index": "intpolicy2"
},
"dest": {
"index": "intpolicy"
}
}
版权声明
本文为[会开车的架构师]所创,转载请带上原文链接,感谢
https://my.oschina.net/u/4629483/blog/4529710
边栏推荐
- 理解格式化原理
- What are the criteria for selecting a cluster server?
- 每个大火的“线上狼人杀”平台,都离不开这个新功能
- Details of dapr implementing distributed stateful service
- Jetcache buried some of the operation, you can't accept it
- It's easy to operate. ThreadLocal can also be used as a cache
- 检测证书过期脚本
- Introduction to X Window System
- StickEngine-架构12-通信协议
- How to customize sorting for pandas dataframe
猜你喜欢
Building a new generation cloud native data lake with iceberg on kubernetes
EOS founder BM: what's the difference between UE, UBI and URI?
大数据处理黑科技:揭秘PB级数仓GaussDB(DWS) 并行计算技术
游戏开发中的新手引导与事件管理系统
MongoDB与SQL常用语法对应表
Use modelarts quickly, zero base white can also play AI!
CCR coin frying robot: the boss of bitcoin digital currency, what you have to know
ado.net和asp.net的关系
大道至简 html + js 实现最朴实的小游戏俄罗斯方块
MeterSphere开发者手册
随机推荐
What are PLC Analog input and digital input
From overseas to China, rancher wants to do research on container cloud market
2020年数据库技术大会助力技术提升
Music generation through deep neural network
MeterSphere开发者手册
Tron smart wallet PHP development kit [zero TRX collection]
事件监听问题
It's time for your financial report to change to a more advanced style -- financial analysis cockpit
The dynamic thread pool in Kitty supports Nacos and Apollo multi configuration centers
What knowledge do Python automated testing learn?
C#和C/C++混合编程系列5-内存管理之GC协同
解决 WPF 绑定集合后数据变动界面却不更新的问题
C + + and C + + programmers are about to be eliminated from the market
Diamond standard
Asp.Net Core learning notes: Introduction
华为Mate 40 系列搭载HMS有什么亮点?
文件过多时ls命令为什么会卡住?
Introduction to X Window System
Behind the record breaking Q2 revenue of Alibaba cloud, the cloud opening mode is reshaping
给字节的学姐讲如何准备“系统设计面试”