当前位置:网站首页>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
边栏推荐
- Asp.Net Core learning notes: Introduction
- html+vue.js 實現分頁可相容IE
- What are Devops
- Shh! Is this really good for asynchronous events?
- 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
- 华为云微认证考试简介
- (2) ASP.NET Core3.1 Ocelot routing
- 【:: 是什么语法?】
- IPFs rudder filecoin landing at the same time, fil currency price broke a thousand
- 【ElasticSearch搜索引擎】
猜你喜欢
What is alicloud's experience of sweeping goods for 100 yuan?
Description of phpshe SMS plug-in
IPFs rudder filecoin landing at the same time, fil currency price broke a thousand
C + + and C + + programmers are about to be eliminated from the market
C# 调用SendMessage刷新任务栏图标(强制结束时图标未消失)
Even liver three all night, jvm77 high frequency interview questions detailed analysis, this?
【ElasticSearch搜索引擎】
Using NLP and ml to extract and construct web data
Python filtering sensitive word records
Flink's datasource Trilogy 2: built in connector
随机推荐
快速排序为什么这么快?
Using NLP and ml to extract and construct web data
Analysis of ThreadLocal principle
新建一个空文件占用多少磁盘空间?
What is alicloud's experience of sweeping goods for 100 yuan?
【转发】查看lua中userdata的方法
一路踩坑,被迫聊聊 C# 代码调试技巧和远程调试
Asp.Net Core learning notes: Introduction
How to demote domain controllers and later in Windows Server 2012
代码生成器插件与Creator预制体文件解析
面试官: ShardingSphere 学一下吧
Introduction to the structure of PDF417 bar code system
Individual annual work summary and 2019 work plan (Internet)
2020年数据库技术大会助力技术提升
PHP application docking justswap special development kit【 JustSwap.PHP ]
JNI-Thread中start方法的呼叫與run方法的回撥分析
事务的隔离级别与所带来的问题
Custom function form of pychar shortcut key
游戏开发中的新手引导与事件管理系统
Unity性能优化整理