- The
type
should belong
- notkeyword
- The
script
should use theemit
method to emit calculated values: Map a runtime field | Elasticsearch Guide [7.13] | Elastic
Example:
"runtime": {
"ab_sum": {
"type": "long",
"script": {
"source": "emit(doc['field_a'].value + doc['field_b'].value)"
}
}
}