elastic-builder
elastic-builder copied to clipboard
Support lang and params in RuntimeField script for runtime_mappings
Currently, RuntimeField does not support the lang
and params
fields inside the script for runtime_mappings, but this is supported by Elasticsearch.
Example:
{
"runtime_mappings": {
"measure": {
"type": "long",
"script": {
"lang": "painless",
"source": "emit(doc['measure'].value * params.factor);",
"params": {
"factor": 2
}
}
}
},
"aggs": {
"measure": {
"terms": {
"field": "measure"
}
}
}
}
Ref: https://www.elastic.co/guide/en/elasticsearch/reference/current/runtime-mapping-fields.html
I opened a PR with the fix: https://github.com/sudo-suhas/elastic-builder/pull/202