ElasticSearch: access document nested value in groovy script
问题 I have a document stored in ElasticSearch as below. _source: { "firstname": "John", "lastname": "Smith", "medals":[ { "bucket": 100, "count": 1 }, { "bucket": 150, "count": 2 } ] } I can access the string type value inside a document using doc.firstname for scripted metric aggregation http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-aggregations-metrics-scripted-metric-aggregation.html. But I am not able to get the field value using doc.medals[0].bucket. Can you