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
Why are we getting this on _version? How can we get _version from our script that is extending AbstractSearchScript?