How to use "script fields" on nested type in ElasticSearch? How to use "script fields" on nested type in ElasticSearch? elasticsearch elasticsearch

How to use "script fields" on nested type in ElasticSearch?


This script should work:

"script_fields": {    "custom_field": {        "script": {            "lang": "painless",            "source": "params['_source']['comments'].size()"        }    }}