Skip to content

Instantly share code, notes, and snippets.

@eskibars
Created November 18, 2016 15:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eskibars/0f0ff0303d9d166c02cc547af5b2c358 to your computer and use it in GitHub Desktop.
Save eskibars/0f0ff0303d9d166c02cc547af5b2c358 to your computer and use it in GitHub Desktop.
simulate painless script
POST _ingest/pipeline/_simulate
{
"pipeline" :
{
"description": "_description",
"processors": [
{
"script":
{
"lang": "painless",
"inline": "if (ctx._id == '2') { ctx._id = params.foo; }",
"params":
{
"foo" : "bar"
}
}
}
]
},
"docs": [
{
"_index": "shanetest",
"_type": "shanetest",
"_id": "1",
"_source": {
"field_a": 3
}
},
{
"_index": "shanetest",
"_type": "shanetest",
"_id": "2",
"_source": {
"field_a": 6
}
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment