当前位置:网站首页>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
边栏推荐
- Look! Internet, e-commerce offline big data analysis best practice! (Internet disk link attached)
- 【自学unity2d传奇游戏开发】如何让角色动起来
- How to get started with new HTML5 (2)
- 意派Epub360丨你想要的H5模板都在这里,电子书、大转盘、红包雨、问卷调查……
- Recommendation system based on deep learning
- Discussion on the technical scheme of text de duplication (1)
- Flink's datasource Trilogy 2: built in connector
- The dynamic thread pool in Kitty supports Nacos and Apollo multi configuration centers
- Installing ns-3 on ubuntu18.04
- Read the advantages of Wi Fi 6 over Wi Fi 5 in 3 minutes
猜你喜欢
What are PLC Analog input and digital input
What are the criteria for selecting a cluster server?
Free patent download tutorial (HowNet, Espacenet)
游戏主题音乐对游戏的作用
大道至简 html + js 实现最朴实的小游戏俄罗斯方块
如何在终端启动Coda 2中隐藏的首选项?
消息队列(MessageQueue)-分析
Custom function form of pychar shortcut key
Top 5 Chinese cloud manufacturers in 2018: Alibaba cloud, Tencent cloud, AWS, telecom, Unicom
新建一个空文件占用多少磁盘空间?
随机推荐
代码生成器插件与Creator预制体文件解析
Interpretation of Cocos creator source code: engine start and main loop
Lane change detection
[Xinge education] poor learning host computer series -- building step 7 Simulation Environment
How to demote domain controllers and later in Windows Server 2012
Construction of encoder decoder model with keras LSTM
StickEngine-架构11-消息队列(MessageQueue)
JNI-Thread中start方法的呼叫與run方法的回撥分析
01. SSH Remote terminal and websocket of go language
Discussion on the technical scheme of text de duplication (1)
事务的本质和死锁的原理
Top 5 Chinese cloud manufacturers in 2018: Alibaba cloud, Tencent cloud, AWS, telecom, Unicom
StickEngine-架构12-通信协议
一部完整的游戏,需要制作哪些音乐?
python100例項
What are PLC Analog input and digital input
It's easy to operate. ThreadLocal can also be used as a cache
事务的隔离级别与所带来的问题
How to turn data into assets? Attracting data scientists
华为云微认证考试简介