当前位置:网站首页>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
边栏推荐
- 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
- Discussion on the technical scheme of text de duplication (1)
- Outsourcing is really difficult. As an outsourcer, I can't help sighing.
- Description of phpshe SMS plug-in
- What are Devops
- hdu3974 Assign the task線段樹 dfs序
- Even liver three all night, jvm77 high frequency interview questions detailed analysis, this?
- What is alicloud's experience of sweeping goods for 100 yuan?
- 华为云微认证考试简介
- Get twice the result with half the effort: automation without cabinet
猜你喜欢
Gather in Beijing! The countdown to openi 2020
What is the purchasing supplier system? Solution of purchasing supplier management platform
嘉宾专访|2020 PostgreSQL亚洲大会阿里云数据库专场:曾文旌
Live broadcast preview | micro service architecture Learning Series live broadcast phase 3
每个大火的“线上狼人杀”平台,都离不开这个新功能
新建一个空文件占用多少磁盘空间?
理解格式化原理
JVM内存分配 -Xms128m -Xmx512m -XX:PermSize=128m -XX:MaxPermSize=512m
MongoDB与SQL常用语法对应表
What course of artificial intelligence? Will it replace human work?
随机推荐
大会倒计时|2020 PostgreSQL亚洲大会-中文分论坛议程安排
Xmppmini project details: step by step from the principle of practical XMPP technology development 4. String decoding secrets and message package
Outsourcing is really difficult. As an outsourcer, I can't help sighing.
2020年第四届中国 BIM (数字建造)经理高峰论坛即将在杭举办
開源一套極簡的前後端分離專案腳手架
What if the front end doesn't use spa? - Hacker News
In depth to uncover the bottom layer of garbage collection, this time let you understand her thoroughly
DC-1靶機
Lane change detection
Music generation through deep neural network
[Xinge education] poor learning host computer series -- building step 7 Simulation Environment
Chainlink brings us election results into blockchain everipedia
It's time for your financial report to change to a more advanced style -- financial analysis cockpit
MeterSphere开发者手册
Will blockchain be the antidote to the global epidemic accelerating the transformation of Internet enterprises?
Swagger 3.0 brushes the screen every day. Does it really smell good?
ERD-ONLINE 免费在线数据库建模工具
Free patent download tutorial (HowNet, Espacenet)
What is the purchasing supplier system? Solution of purchasing supplier management platform
Filecoin has completed a major upgrade and achieved four major project progress!