当前位置:网站首页>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
边栏推荐
- 仅用六种字符来完成Hello World,你能做到吗?
- Chainlink brings us election results into blockchain everipedia
- Read the advantages of Wi Fi 6 over Wi Fi 5 in 3 minutes
- CloudQuery V1.2.0 版本发布
- Use modelarts quickly, zero base white can also play AI!
- Digital city responds to relevant national policies and vigorously develops the construction of digital twin platform
- 大会倒计时|2020 PostgreSQL亚洲大会-中文分论坛议程安排
- 【字节跳动 秋招岗位开放啦】Ohayoo!放学别走,我想约你做游戏!!!
- What if the front end doesn't use spa? - Hacker News
- Discussion on the technical scheme of text de duplication (1)
猜你喜欢

嘉宾专访|2020 PostgreSQL亚洲大会阿里云数据库专场:曾文旌

C#和C/C++混合编程系列5-内存管理之GC协同

Even liver three all night, jvm77 high frequency interview questions detailed analysis, this?

嘉宾专访|2020 PostgreSQL亚洲大会阿里云数据库专场:王涛

华为Mate 40 系列搭载HMS有什么亮点?

GUI engine evaluation index

事务的本质和死锁的原理

检测证书过期脚本

面试官: ShardingSphere 学一下吧

Free patent download tutorial (HowNet, Espacenet)
随机推荐
面试官: ShardingSphere 学一下吧
Discussion on the technical scheme of text de duplication (1)
Individual annual work summary and 2019 work plan (Internet)
Even liver three all night, jvm77 high frequency interview questions detailed analysis, this?
游戏开发中的新手引导与事件管理系统
Xmppmini project details: step by step from the principle of practical XMPP technology development 4. String decoding secrets and message package
FastThreadLocal 是什么鬼?吊打 ThreadLocal 的存在!!
Named entity recognition in natural language processing: tanford core LP ner (1)
MongoDB与SQL常用语法对应表
Jmeter——ForEach Controller&Loop Controller
Analysis of ThreadLocal principle
視覺滾動[反差美]
小游戏云开发入门
It is really necessary to build a distributed ID generation service
Asp.Net Core learning notes: Introduction
快速排序为什么这么快?
C語言I部落格作業03
【應用程式見解 Application Insights】Application Insights 使用 Application Maps 構建請求鏈路檢視
Multi robot market share solution
游戏主题音乐对游戏的作用