# Acces to datatype range

**URL:** <https://discuss.elastic.co/t/acces-to-datatype-range/104031>\
**Category:** Elasticsearch\
**Created:** [October 15, 2017, 6:00pm UTC](https://discuss.elastic.co/t/acces-to-datatype-range/104031 "2017-10-15T18:00:38Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![abkrim](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/abkrim/32/20217_2.png) [@abkrim](https://discuss.elastic.co/u/abkrim)\
**Post date:** [October 15, 2017, 6:00pm UTC](https://discuss.elastic.co/t/acces-to-datatype-range/104031/1 "2017-10-15T18:00:38Z")

</div>

I need access to "gte" and "lte" values on a data mapping with integer\_range of my scoreing scripts (Painless)

Try access data with severals methods

```
doc["trl"].gte.value
doc["trl"].gte
doc["trl"]["gte"].value
doc["trl"]["gte"]

```

But get error, and for error, I think my error it's I don't know how to access to range data type

```
"script_stack": [
"org.elasticsearch.index.mapper.MappedFieldType.fielddataBuilder(MappedFieldType.java:107)",
"org.elasticsearch.index.fielddata.IndexFieldDataService.getForField(IndexFieldDataService.java:111)",
"org.elasticsearch.search.lookup.LeafDocLookup$1.run(LeafDocLookup.java:84)",
"org.elasticsearch.search.lookup.LeafDocLookup$1.run(LeafDocLookup.java:81)",
"java.security.AccessController.doPrivileged(Native Method)",
"org.elasticsearch.search.lookup.LeafDocLookup.get(LeafDocLookup.java:81)",
"org.elasticsearch.search.lookup.LeafDocLookup.get(LeafDocLookup.java:36)",
"gte = doc[\"trl\"].gte.value;\nint ",
" ^---- HERE"
],
"script": "excelle_scoring_01.painless",
"lang": "painless",
"caused_by": {
"type": "illegal_argument_exception",
"reason": "Fielddata is not supported on field [trl] of type [integer_range]"

```

Data type integer\_range

```
mapping
    'trl' => [
      'type' => 'integer_range'
    ],

```

Response

```
"trl": {
            "gte": 7,
            "lte": 9
},
```

---

<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:** [November 12, 2017, 6:01pm UTC](https://discuss.elastic.co/t/acces-to-datatype-range/104031/2 "2017-11-12T18:01:03Z")

</div>

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