当前位置:网站首页>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
边栏推荐
- Will blockchain be the antidote to the global epidemic accelerating the transformation of Internet enterprises?
- Get twice the result with half the effort: automation without cabinet
- What course of artificial intelligence? Will it replace human work?
- 解决 WPF 绑定集合后数据变动界面却不更新的问题
- Even liver three all night, jvm77 high frequency interview questions detailed analysis, this?
- Shh! Is this really good for asynchronous events?
- 代码重构之法——方法重构分析
- How to get started with new HTML5 (2)
- Kubernetes and OAM to build a unified, standardized application management platform knowledge! (Internet disk link attached)
- Details of dapr implementing distributed stateful service
猜你喜欢

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

What are the criteria for selecting a cluster server?

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

Free patent download tutorial (HowNet, Espacenet)

image operating system windows cannot be used on this platform

游戏主题音乐对游戏的作用

What knowledge do Python automated testing learn?

ado.net和asp.net的关系

It's time for your financial report to change to a more advanced style -- financial analysis cockpit

Helping financial technology innovation and development, atfx is at the forefront of the industry
随机推荐
【学习】接口测试用例编写和测试关注点
What are manufacturing and new automation technologies?
Individual annual work summary and 2019 work plan (Internet)
Azure data factory (3) integrate azure Devops to realize CI / CD
Free patent download tutorial (HowNet, Espacenet)
Named entity recognition in natural language processing: tanford core LP ner (1)
What is alicloud's experience of sweeping goods for 100 yuan?
html+vue.js 實現分頁可相容IE
检测证书过期脚本
Uncle Bob: the software architecture is similar to a house. Object oriented is the structure of the house, and the water pipe is functional programming
消息队列(MessageQueue)-分析
Simple summary of front end modularization
代码重构之法——方法重构分析
image operating system windows cannot be used on this platform
行为型模式之备忘录模式
只有1个字节的文件实际占用多少磁盘空间
The importance of big data application is reflected in all aspects
How to turn data into assets? Attracting data scientists
大会倒计时|2020 PostgreSQL亚洲大会-中文分论坛议程安排
Xmppmini project details: step by step from the principle of practical XMPP technology development 4. String decoding secrets and message package