Issus about elasticsearch nested pipeline

–pipeline_for_distribution
PUT _ingest/pipeline/pipeline_for_distribution
{
“description”: “a pipeline for distribution”,
“processors”: [
{
“pipeline”:{
“name”: “pipeline_for_set”,
“if”: “”"
String tagss = ctx[‘tags’];
if (tagss.toLowerCase().contains(‘openstack’)) {
return true;
}
return false;
“”"
}
},
{
“pipeline”: {
“name”: “pipeline_for_split”,
“if”: “”"
String tagsx = ctx[‘tags’];
if (tagsx.toLowerCase().contains(‘hadoop’)) {
return true;
}
return false;
“”"
}
}
]
}
–pipeline_for_split
PUT _ingest/pipeline/pipeline_for_split
{
“description”: “a pipeline for split”,
“processors”: [
{
“split”: {
“field”: “tags”,
“separator”: “,”
}
}
]
}
–pipeline_for_set or son pipeline
PUT _ingest/pipeline/pipeline_for_set
{
“description”: “a pipeline for set”,
“processors”: [
//not ok
{
“pipeline”: {
“name”: “pipeline_for_split”
}
},
//ok
{
“set”:{
“field”: “views”,
“value”: 0
}
}
]
}
–test pipeline
POST _ingest/pipeline/_simulate
{
“pipeline”: {
“description”: “to split blog tags”,
“processors”: [
{
“pipeline”: {
“name”: “pipeline_for_distribution”
}
}
]
},

“docs”: [
{
“_index”:“index”,
“_id”:“id”,
“_source”:{
“title”:“Introducing big data…”,
“tags”:“hadoop,elasticsearch,spark”,
“content”:“You konw, for big data”
}
},
{
“_index”:“index”,
“_id”:“idxx”,
“_source”:{
“title”:“Introducing cloud computering”,
“tags”:“openstack,k8s”,
“content”:“You konw, for cloud”
}
}
]
}
– success result
{
“docs” : [
{
“doc” : {
“_index” : “index”,
“_type” : “_doc”,
“_id” : “id”,
“_source” : {
“title” : “Introducing big data…”,
“content” : “You konw, for big data”,
“tags” : [
“hadoop”,
“elasticsearch”,
“spark”
]
},
“_ingest” : {
“timestamp” : “2021-11-11T02:50:35.625742716Z”
}
}
},
{
“doc” : {
“_index” : “index”,
“_type” : “_doc”,
“_id” : “idxx”,
“_source” : {
“title” : “Introducing cloud computering”,
“content” : “You konw, for cloud”,
“views” : 0,
“tags” : “openstack,k8s”
},
“_ingest” : {
“timestamp” : “2021-11-11T02:50:35.625751505Z”
}
}
}
]
}

if set son pipeline_for_split to pipeline_for_set, error occure following:
{
“error” : {
“root_cause” : [
{
“type” : “script_exception”,
“reason” : “runtime error”,
“script_stack” : [
“”“tagsx = ctx[‘tags’];
“””,
" ^---- HERE"
],
“script” : " …",
“lang” : “painless”,
“position” : {
“offset” : 34,
“start” : 23,
“end” : 53
}
}
],
“type” : “script_exception”,
“reason” : “runtime error”,
“script_stack” : [
“”“tagsx = ctx[‘tags’];
“””,
" ^---- HERE"
],
“script” : " …",
“lang” : “painless”,
“position” : {
“offset” : 34,
“start” : 23,
“end” : 53
},
“caused_by” : {
“type” : “class_cast_exception”,
“reason” : “cannot implicitly cast def [org.opensearch.ingest.ConditionalProcessor.UnmodifiableIngestList] to java.lang.String”
}
}
}

anyone can help with this? many thanks :wink: