-
Notifications
You must be signed in to change notification settings - Fork 25.8k
Better handling of inline scripts in ingest #23824
Copy link
Copy link
Closed
Labels
:Distributed/Ingest NodeExecution or management of Ingest PipelinesExecution or management of Ingest Pipelines>enhancementgood first issuelow hanging fruitlow hanging fruithelp wantedadoptmeadoptme
Description
Anywhere that scripts are used, we allow writing an inline script in a short form, eg:
{ "script": {
"lang": "painless",
"inline": "ctx.foo='bar'
}}
can also be written as:
{ "script": "ctx.foo='bar'"}
If I try this in ingest:
POST _ingest/pipeline/_simulate
{
"pipeline": {
"processors": [
{
"script": "ctx.foo='bar'"
}
]
},
"docs": [
{
"_index": "t",
"_type": "t",
"_id": "1",
"_source": {}
}
]
}
I get:
{
"type": "class_cast_exception",
"reason": "java.lang.String cannot be cast to java.util.Map"
}
While I understand that all processors expect an object and so the short form may not be supported (although it'd be nice to make an exception for scripts), we should at least have an exception which is easier to understand.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
:Distributed/Ingest NodeExecution or management of Ingest PipelinesExecution or management of Ingest Pipelines>enhancementgood first issuelow hanging fruitlow hanging fruithelp wantedadoptmeadoptme
Type
Fields
Give feedbackNo fields configured for issues without a type.