将_source用于嵌套属性。Doc保留已加载到内存中的字段。嵌套文档可能无法加载,应使用_source访问。
例如:
GET index/type { "aggs": { "NAME": { "scripted_metric": { "init_script": "_agg['collection']=[]", "map_script": "_agg['tr'].add(_source.propertry1.prop);", "combine_script": "return _agg", "reduce_script": "return _aggs" } } }, "size": 0}


