当前位置:网站首页>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
边栏推荐
- Kubernetes and OAM to build a unified, standardized application management platform knowledge! (Internet disk link attached)
- Read the advantages of Wi Fi 6 over Wi Fi 5 in 3 minutes
- What are the common problems of DTU connection
- 使用 Iceberg on Kubernetes 打造新一代雲原生資料湖
- 【字节跳动 秋招岗位开放啦】Ohayoo!放学别走,我想约你做游戏!!!
- What is the purchasing supplier system? Solution of purchasing supplier management platform
- Network security engineer Demo: the original * * is to get your computer administrator rights! [maintain]
- The importance of big data application is reflected in all aspects
- Lane change detection
- Ronglian completed US $125 million f round financing
猜你喜欢
How to understand Python iterators and generators?
How to turn data into assets? Attracting data scientists
Use modelarts quickly, zero base white can also play AI!
Get twice the result with half the effort: automation without cabinet
What is alicloud's experience of sweeping goods for 100 yuan?
FastThreadLocal 是什么鬼?吊打 ThreadLocal 的存在!!
Ronglian completed US $125 million f round financing
游戏开发中的新手引导与事件管理系统
Jetcache buried some of the operation, you can't accept it
如何对数据库账号权限进行精细化管理?
随机推荐
Description of phpshe SMS plug-in
視覺滾動[反差美]
Jmeter——ForEach Controller&Loop Controller
Construction of encoder decoder model with keras LSTM
Introduction to X Window System
Lane change detection
CloudQuery V1.2.0 版本发布
DRF JWT authentication module and self customization
【應用程式見解 Application Insights】Application Insights 使用 Application Maps 構建請求鏈路檢視
一路踩坑,被迫聊聊 C# 代码调试技巧和远程调试
Installing ns-3 on ubuntu18.04
Music generation through deep neural network
【:: 是什么语法?】
Helping financial technology innovation and development, atfx is at the forefront of the industry
Named entity recognition in natural language processing: tanford core LP ner (1)
【转发】查看lua中userdata的方法
What are Devops
How to hide part of barcode text in barcode generation software
【字节跳动 秋招岗位开放啦】Ohayoo!放学别走,我想约你做游戏!!!
Ronglian completed US $125 million f round financing