当前位置:网站首页>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
边栏推荐
- Pollard's Rho algorithm
- Basic usage of GDB debugging
- 事件监听问题
- How to customize sorting for pandas dataframe
- 给字节的学姐讲如何准备“系统设计面试”
- What knowledge do Python automated testing learn?
- Behind the record breaking Q2 revenue of Alibaba cloud, the cloud opening mode is reshaping
- Lane change detection
- 文件过多时ls命令为什么会卡住?
- hdu3974 Assign the task線段樹 dfs序
猜你喜欢

C# 调用SendMessage刷新任务栏图标(强制结束时图标未消失)

How to hide part of barcode text in barcode generation software

The AI method put forward by China has more and more influence. Tianda et al. Mined the development law of AI from a large number of literatures

Behind the first lane level navigation in the industry

【自学unity2d传奇游戏开发】地图编辑器

Behind the record breaking Q2 revenue of Alibaba cloud, the cloud opening mode is reshaping

Description of phpshe SMS plug-in

Diamond standard

MongoDB与SQL常用语法对应表

游戏开发中的新手引导与事件管理系统
随机推荐
代码重构之法——方法重构分析
美团内部讲座|周烜:华东师范大学的数据库系统研究
Use modelarts quickly, zero base white can also play AI!
华为Mate 40 系列搭载HMS有什么亮点?
只有1个字节的文件实际占用多少磁盘空间
Helping financial technology innovation and development, atfx is at the forefront of the industry
Chainlink brings us election results into blockchain everipedia
Swagger 3.0 brushes the screen every day. Does it really smell good?
Introduction to the structure of PDF417 bar code system
How to understand Python iterators and generators?
Outsourcing is really difficult. As an outsourcer, I can't help sighing.
electron 實現檔案下載管理器
CCR coin frying robot: the boss of bitcoin digital currency, what you have to know
Asp.Net Core learning notes: Introduction
How to get started with new HTML5 (2)
The dynamic thread pool in Kitty supports Nacos and Apollo multi configuration centers
Jetcache buried some of the operation, you can't accept it
意派Epub360丨你想要的H5模板都在这里,电子书、大转盘、红包雨、问卷调查……
What is alicloud's experience of sweeping goods for 100 yuan?
WeihanLi.Npoi 1.11.0/1.12.0 Release Notes