es情况
使用方法
index准备
- POST index_src_1/_doc/1
- {
- "id":"111111",
- "author": "zlh"
- }
复制代码 GET index_src_1/_search查询得到字符串id
- "_source" : {
- "id" : "111111",
- "author" : "zlh"
- }
复制代码 _reindex复制index
- POST /_reindex
- {
- "source": {
- "index": "index_src_1",
- "size": 10
- },
- "dest": {
- "index": "index_src_2"
- }
- }
复制代码 GET index_src_2/_search查询得到字符串id
- "_source" : {
- "id" : "111111",
- "author" : "zlh"
- }
复制代码 希望将原index index_src_1中id为string类型转为目标index中long类型
运用 convert 创建 pipeline
- PUT _ingest/pipeline/zlh-pipeline-id
- {
- "description": "描述:运用convert创建pipeline,将id字段的内容转换为long",
- "processors" : [
- {
- "convert" : {
- "field" : "id",
- "type": "long"
- }
- }
- ]
- }
复制代码 _reindex复制index
- POST /_reindex
- {
- "source": {
- "index": "index_src_1",
- "size": 10
- },
- "dest": {
- "index": "index_src_2",
- "pipeline": "zlh-pipeline-id"
- }
- }
复制代码 GET index_src_2/_search查询得到long型id
- "_source" : {
- "author" : "zlh",
- "id" : 111111
- }
复制代码 免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!更多信息从访问主页:qidao123.com:ToB企服之家,中国第一个企服评测及商务社交产业平台。 |