栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 前沿技术 > 大数据 > 大数据系统

Elasticsearch 修改索引字段类型

Elasticsearch 修改索引字段类型

es创建索引后,不支持直接修改field 类型,可以使用创建中间索引,用_reindex来实现

比如需要修改test_index索引中的字段类型

1.先创建test_index_copy索引

2.将test_index 索引 _reindex 到test_index_copy ,相当于copy

POST _reindex
{
  "source": {
    "index":"test_index"
  },
  "dest": {
    "index": "test_index_copy"
  }
}

3.DELETE  test_index    删除test_index索引,再重新创建test_index,字段更新成你想要的

4 再将test_index_copy索引 _reindex 到 test_index ,成功后删除test_index_copy

POST _reindex
{
  "source": {
    "index":"test_index_copy"
  },
  "dest": {
    "index": "test_index"
  }
}

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/673951.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号