Skip to content

Instantly share code, notes, and snippets.

@spinscale
Created December 19, 2016 14:27
Show Gist options
  • Save spinscale/7bba10f5fcd935653617bf653577ea20 to your computer and use it in GitHub Desktop.
Save spinscale/7bba10f5fcd935653617bf653577ea20 to your computer and use it in GitHub Desktop.
kv in painless
POST _ingest/pipeline/_simulate
{
"pipeline" : {
"description": "A pipeline to do named entity extraction",
"processors": [
{
"script": {
"lang": "painless",
"inline": "ctx.params = [:] ; /&/.splitAsStream(ctx.x).forEach(pair -> { def x = /=/.split(pair); ctx.params[x[0]] = x[1]; })"
}
}
]
},
"docs" : [
{ "_source": { "x":"a=b&c=d&e=f"}}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment