Can an ElasticSearch ingest pipeline use a search template as its script?
Specifically, I\'d like to configure an ingest pipeline so that whenever data of a particul
So the ingest script
pipeline is already the combination your looking for,
you should use the if
option, read about it here.
Your pipeline should look something like this:
{
"script": {
"if": "ctx.type == 'thisType'",
"source": """
//calculation here
ctx.newField = value;
"""
}
}
I recommend after you create your pipeline you test it using simulate as it will make your life much easier.
EDIT:
Thanks to @val that cleared up some confusion on my part. So you can't really do exactly what you want however i recommend you read about enrich pipeline. with some setup you might be able to make it happen.