# Fielddata is not supported on field \_version

**URL:** <https://discuss.elastic.co/t/fielddata-is-not-supported-on-field--version/86796>\
**Category:** Elasticsearch\
**Created:** [May 23, 2017, 10:57am UTC](https://discuss.elastic.co/t/fielddata-is-not-supported-on-field--version/86796 "2017-05-23T10:57:53Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hector\_R](https://avatars.discourse-cdn.com/v4/letter/h/df705f/32.png) [@Hector\_R](https://discuss.elastic.co/u/Hector_R)\
**Post date:** [May 23, 2017, 10:57am UTC](https://discuss.elastic.co/t/fielddata-is-not-supported-on-field--version/86796/1 "2017-05-23T10:57:53Z")

</div>

I am facing this exception when trying to get \_version field from a Script:

**java.lang.IllegalArgumentException: Fielddata is not supported on field [\_version] of type [\_version]**

Looking at elasticsearch documentation it seems fielddata is disabled on text fields by default.

[https://www.elastic.co/guide/en/elasticsearch/reference/current/fielddata.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/fielddata.html)

**Why are we getting this on \_version? How can we get \_version from our script that is extending AbstractSearchScript?**

---

<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:** [June 20, 2017, 10:58am UTC](https://discuss.elastic.co/t/fielddata-is-not-supported-on-field--version/86796/2 "2017-06-20T10:58:06Z")

</div>

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