使用 elasticsearch 中的 pipeline ingest 重命名元素
Using the pipeline ingest in elasticsearch to rename an element
我正在尝试重命名 elasticsearch 中的一个元素,但我 运行 遇到了问题。
我试图重命名这个元素 "list to lists" 所以我尝试 _source.list 并且成功了。
好的,在那之后,我尝试将 _source.list.metaData 重命名为 metaDatas,但我似乎 运行 遇到了问题。这是我正在使用的代码,这也是映射。
PUT _ingest/pipeline/pipeline_rename_xxx
{
"description" : "rename xxx",
"processors" : [
{
"rename": {
"field": "_source.list.metaDatas",
"target_field": "metaDatas"
}
}
]
}
{
"tweet": {
"mappings": {
"document": {
"properties": {
"list": {
"properties": {
"metaData": {
"reason": "java.lang.IllegalArgumentException: java.lang.IllegalArgumentException: field [_source.list.metaData] doesn't exist"
This is what i am expecting
{
"tweet": {
"mappings": {
"document": {
"properties": {
"list": {
"properties": {
"metaDatas": {
I will appreciate any help. Thanks
POST _reindex
{
"source": {
"index": "promoted"
},
"dest": {
"index": "new_promoted"
}
}
PUT _ingest/pipeline/pipeline_rename_xxx
{
"description": "rename xxx",
"processors": [
{
"foreach": {
"field": "list",
"processor": {
"foreach": {
"field": "_ingest._value.promoted.league",
"processor": {
"foreach": {
"field": "_ingest._value.league",
"processor": {
"rename": {
"field": "_ingest._value.division.position",
"target_field": "_ingest._value.division.positions"
}
}
}
}
}
}
}
}
]
}
我正在尝试重命名 elasticsearch 中的一个元素,但我 运行 遇到了问题。
我试图重命名这个元素 "list to lists" 所以我尝试 _source.list 并且成功了。
好的,在那之后,我尝试将 _source.list.metaData 重命名为 metaDatas,但我似乎 运行 遇到了问题。这是我正在使用的代码,这也是映射。
PUT _ingest/pipeline/pipeline_rename_xxx
{
"description" : "rename xxx",
"processors" : [
{
"rename": {
"field": "_source.list.metaDatas",
"target_field": "metaDatas"
}
}
]
}
{
"tweet": {
"mappings": {
"document": {
"properties": {
"list": {
"properties": {
"metaData": {
"reason": "java.lang.IllegalArgumentException: java.lang.IllegalArgumentException: field [_source.list.metaData] doesn't exist"
This is what i am expecting
{
"tweet": {
"mappings": {
"document": {
"properties": {
"list": {
"properties": {
"metaDatas": {
I will appreciate any help. Thanks
POST _reindex
{
"source": {
"index": "promoted"
},
"dest": {
"index": "new_promoted"
}
}
PUT _ingest/pipeline/pipeline_rename_xxx
{
"description": "rename xxx",
"processors": [
{
"foreach": {
"field": "list",
"processor": {
"foreach": {
"field": "_ingest._value.promoted.league",
"processor": {
"foreach": {
"field": "_ingest._value.league",
"processor": {
"rename": {
"field": "_ingest._value.division.position",
"target_field": "_ingest._value.division.positions"
}
}
}
}
}
}
}
}
]
}