当前位置:网站首页>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
边栏推荐
- 常用SQL语句总结
- 大道至简 html + js 实现最朴实的小游戏俄罗斯方块
- 【学习】接口测试用例编写和测试关注点
- 視覺滾動[反差美]
- Asp.Net Core learning notes: Introduction
- Even liver three all night, jvm77 high frequency interview questions detailed analysis, this?
- 理解格式化原理
- electron 實現檔案下載管理器
- Introduction to Google software testing
- It's easy to operate. ThreadLocal can also be used as a cache
猜你喜欢

Recommendation system based on deep learning

消息队列(MessageQueue)-分析

(1) ASP.NET Introduction to core3.1 Ocelot

大数据处理黑科技:揭秘PB级数仓GaussDB(DWS) 并行计算技术

How to turn data into assets? Attracting data scientists

It's easy to operate. ThreadLocal can also be used as a cache

前端未來趨勢之原生API:Web Components

Custom function form of pychar shortcut key

01. SSH Remote terminal and websocket of go language

Read the advantages of Wi Fi 6 over Wi Fi 5 in 3 minutes
随机推荐
For a while, a dynamic thread pool was created, and the source code was put into GitHub
Using NLP and ml to extract and construct web data
意派Epub360丨你想要的H5模板都在这里,电子书、大转盘、红包雨、问卷调查……
What is the purchasing supplier system? Solution of purchasing supplier management platform
Even liver three all night, jvm77 high frequency interview questions detailed analysis, this?
Gather in Beijing! The countdown to openi 2020
JVM内存分配 -Xms128m -Xmx512m -XX:PermSize=128m -XX:MaxPermSize=512m
行为型模式之解释器模式
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
新建一个空文件占用多少磁盘空间?
Analysis of ThreadLocal principle
事务的隔离级别与所带来的问题
The difference between gbdt and XGB, and the mathematical derivation of gradient descent method and Newton method
Basic principle and application of iptables
【转发】查看lua中userdata的方法
Live broadcast preview | micro service architecture Learning Series live broadcast phase 3
Building a new generation cloud native data lake with iceberg on kubernetes
It's time for your financial report to change to a more advanced style -- financial analysis cockpit
给字节的学姐讲如何准备“系统设计面试”
[C] (original) step by step teach you to customize the control element - 04, ProgressBar (progress bar)