当前位置:网站首页>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
边栏推荐
- Building a new generation cloud native data lake with iceberg on kubernetes
- electron 實現檔案下載管理器
- Humor: hacker programming is actually similar to machine learning!
- A brief history of neural networks
- Gather in Beijing! The countdown to openi 2020
- Elasticsearch Part 6: aggregate statistical query
- 【:: 是什么语法?】
- 检测证书过期脚本
- Ronglian completed US $125 million f round financing
- Elasticsearch数据库 | Elasticsearch-7.5.0应用搭建实战
猜你喜欢

【自学unity2d传奇游戏开发】如何让角色动起来

美团内部讲座|周烜:华东师范大学的数据库系统研究

Recommendation system based on deep learning

Shh! Is this really good for asynchronous events?

Who says cat can't do link tracking? Stand up for me

Filecoin has completed a major upgrade and achieved four major project progress!

Diamond standard

【ElasticSearch搜索引擎】

事务的隔离级别与所带来的问题

It is really necessary to build a distributed ID generation service
随机推荐
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
[Xinge education] poor learning host computer series -- building step 7 Simulation Environment
Helping financial technology innovation and development, atfx is at the forefront of the industry
Try to build my mall from scratch (2): use JWT to protect our information security and perfect swagger configuration
面试官: ShardingSphere 学一下吧
Even liver three all night, jvm77 high frequency interview questions detailed analysis, this?
Using NLP and ml to extract and construct web data
行为型模式之解释器模式
Live broadcast preview | micro service architecture Learning Series live broadcast phase 3
Music generation through deep neural network
Behind the record breaking Q2 revenue of Alibaba cloud, the cloud opening mode is reshaping
How to understand Python iterators and generators?
使用 Iceberg on Kubernetes 打造新一代雲原生資料湖
What are Devops
Who says cat can't do link tracking? Stand up for me
Kubernetes and OAM to build a unified, standardized application management platform knowledge! (Internet disk link attached)
For a while, a dynamic thread pool was created, and the source code was put into GitHub
Application of restful API based on MVC
前端未來趨勢之原生API:Web Components
Description of phpshe SMS plug-in