当前位置:网站首页>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
边栏推荐
- Who says cat can't do link tracking? Stand up for me
- 【自学unity2d传奇游戏开发】地图编辑器
- 检测证书过期脚本
- 大数据处理黑科技:揭秘PB级数仓GaussDB(DWS) 并行计算技术
- What are the common problems of DTU connection
- Music generation through deep neural network
- What are PLC Analog input and digital input
- Cglib 如何实现多重代理?
- 嘉宾专访|2020 PostgreSQL亚洲大会阿里云数据库专场:王涛
- Analysis of ThreadLocal principle
猜你喜欢

What are Devops

检测证书过期脚本

游戏主题音乐对游戏的作用

Named entity recognition in natural language processing: tanford core LP ner (1)

JVM内存分配 -Xms128m -Xmx512m -XX:PermSize=128m -XX:MaxPermSize=512m

大道至简 html + js 实现最朴实的小游戏俄罗斯方块

IPFs rudder filecoin landing at the same time, fil currency price broke a thousand

仅用六种字符来完成Hello World,你能做到吗?

How to turn data into assets? Attracting data scientists

如何在终端启动Coda 2中隐藏的首选项?
随机推荐
DRF JWT authentication module and self customization
2020年第四届中国 BIM (数字建造)经理高峰论坛即将在杭举办
The importance of big data application is reflected in all aspects
StickEngine-架构11-消息队列(MessageQueue)
(2) ASP.NET Core3.1 Ocelot routing
How to customize sorting for pandas dataframe
Music generation through deep neural network
How to hide part of barcode text in barcode generation software
Free patent download tutorial (HowNet, Espacenet)
Read the advantages of Wi Fi 6 over Wi Fi 5 in 3 minutes
GUI engine evaluation index
Introduction to the structure of PDF417 bar code system
In depth to uncover the bottom layer of garbage collection, this time let you understand her thoroughly
Discussion on the development practice of aspnetcore, a cross platform framework
Try to build my mall from scratch (2): use JWT to protect our information security and perfect swagger configuration
【学习】接口测试用例编写和测试关注点
Description of phpshe SMS plug-in
It's time for your financial report to change to a more advanced style -- financial analysis cockpit
【自学unity2d传奇游戏开发】如何让角色动起来
Isn't data product just a report? absolutely wrong! There are university questions in this category