# Question about accessing index statistics in ElasticSearch 5.4.0

**URL:** <https://discuss.elastic.co/t/question-about-accessing-index-statistics-in-elasticsearch-5-4-0/100727>\
**Category:** Elasticsearch\
**Created:** [September 15, 2017, 7:46pm UTC](https://discuss.elastic.co/t/question-about-accessing-index-statistics-in-elasticsearch-5-4-0/100727 "2017-09-15T19:46:32Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mickeystroller](https://avatars.discourse-cdn.com/v4/letter/m/848f3c/32.png) [@mickeystroller](https://discuss.elastic.co/u/mickeystroller)\
**Post date:** [September 15, 2017, 7:46pm UTC](https://discuss.elastic.co/t/question-about-accessing-index-statistics-in-elasticsearch-5-4-0/100727/1 "2017-09-15T19:46:32Z")

</div>

Hi all,

I want to make sure my understanding is correct. In ES 5.4.0, the only way to access index statistics in scripts is to write a custom ScriptEngine which can only be written in Java. If that is the case, I want to further ask whether there is a way to force the usage of Groovy in ES 5.4.0 assuming it has not been completely deleted.

Thanks.

---

<div class="post-metadata">

**Author:** ![mickeystroller](https://avatars.discourse-cdn.com/v4/letter/m/848f3c/32.png) [@mickeystroller](https://discuss.elastic.co/u/mickeystroller)\
**Post date:** [September 16, 2017, 2:04am UTC](https://discuss.elastic.co/t/question-about-accessing-index-statistics-in-elasticsearch-5-4-0/100727/2 "2017-09-16T02:04:53Z")

</div>

I checked and I can force the usage of Groovy. Just curious how I can use painless to access the index statistics such as term frequency in a document.

---

<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:** [October 14, 2017, 2:05am UTC](https://discuss.elastic.co/t/question-about-accessing-index-statistics-in-elasticsearch-5-4-0/100727/3 "2017-10-14T02:05:56Z")

</div>

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