# \[ES 6.7\] Multiple field terms aggregation using scripts

**URL:** <https://discuss.elastic.co/t/es-6-7-multiple-field-terms-aggregation-using-scripts/325383>\
**Category:** Elasticsearch\
**Created:** [February 13, 2023, 12:44pm UTC](https://discuss.elastic.co/t/es-6-7-multiple-field-terms-aggregation-using-scripts/325383 "2023-02-13T12:44:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hi\_Jonk](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hi_jonk/32/105695_2.png) [@Hi\_Jonk](https://discuss.elastic.co/u/Hi_Jonk)\
**Post date:** [February 13, 2023, 12:44pm UTC](https://discuss.elastic.co/t/es-6-7-multiple-field-terms-aggregation-using-scripts/325383/1 "2023-02-13T12:44:46Z")

</div>

In the 6.7 documentation for Terms aggregation, the section on multi field aggregation says that 6.7 does not support multiple field aggregation, and to use scripts instead: [Terms Aggregation | Elasticsearch Guide [6.7] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/6.7/search-aggregations-bucket-terms-aggregation.html#_multi_field_terms_aggregation)

However, in the example for aggregating with scripts, only one field is being used.

Could anyone give an example of how unique combinations of multiple fields can be aggregated using a script?

Thanks!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [March 13, 2023, 12:45pm UTC](https://discuss.elastic.co/t/es-6-7-multiple-field-terms-aggregation-using-scripts/325383/2 "2023-03-13T12:45:38Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
