# Setting the scripting language for inline scripts in TermsAggregation

**URL:** <https://discuss.elastic.co/t/setting-the-scripting-language-for-inline-scripts-in-termsaggregation/26470>\
**Category:** Elasticsearch\
**Created:** [July 29, 2015, 9:28am UTC](https://discuss.elastic.co/t/setting-the-scripting-language-for-inline-scripts-in-termsaggregation/26470 "2015-07-29T09:28:59Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![edmondo1984](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/edmondo1984/32/3517_2.png) [@edmondo1984](https://discuss.elastic.co/u/edmondo1984)\
**Post date:** [July 29, 2015, 9:28am UTC](https://discuss.elastic.co/t/setting-the-scripting-language-for-inline-scripts-in-termsaggregation/26470/1 "2015-07-29T09:28:59Z")

</div>

I am trying to perform a term aggregation using a script to concatenate two fields and I provide a script which is in JavaScript using the JAVA API.

```
    TermsBuilder termsAggregation = AggregationBuilders.terms("myTerm").script(aggregationScript());

```

When I execute the query, it fails with the following error:

nested: ElasticsearchIllegalArgumentException[script\_lang not supported [groovy]];

Why ElasticSearch is trying to use groovy as a scripting language, and why it is not supported?

---

<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:** [July 5, 2017, 11:58pm UTC](https://discuss.elastic.co/t/setting-the-scripting-language-for-inline-scripts-in-termsaggregation/26470/2 "2017-07-05T23:58:25Z")

</div>


