# Script field coercion Out of range

**URL:** <https://discuss.elastic.co/t/script-field-coercion-out-of-range/17809>\
**Category:** Elasticsearch\
**Created:** [May 29, 2014, 2:36pm UTC](https://discuss.elastic.co/t/script-field-coercion-out-of-range/17809 "2014-05-29T14:36:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Evan\_Borden](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/evan_borden/32/1533_2.png) [@Evan\_Borden](https://discuss.elastic.co/u/Evan_Borden)\
**Post date:** [May 29, 2014, 2:36pm UTC](https://discuss.elastic.co/t/script-field-coercion-out-of-range/17809/1 "2014-05-29T14:36:05Z")

</div>

I have two ES installations with identical configuration. The following  
script\_fields query:

curl -XPOST localhost:9200/ -d '  
{"script\_fields": {"foo": {"script": "rint("32768")"}}}  
'

produces the following error on one node and not the other.

{

- timed\_out: false
- \_shards: {
  - total: 4
  - successful: 3
  - failed: 1
  - failures: [
    - {
      - status: 500
      - reason: CompileException[[Error: Value out of range.  
Value:"32768" Radix:10] [Near : {... rint("32768") ....}] ^ [Line: 1,  
Column: 1]]; nested: NumberFormatException[Value out of range.  
Value:"32768" Radix:10];  
}  
]  
}

- hits: {
  - total: 1591475
  - max\_score: 1
  - hits: []  
}

}

The failing node is attempting to coerce to a short, but I cannot find any  
reason for this behavior.

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/a42e0adc-fa94-4159-822b-44464d3bf4f2%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/a42e0adc-fa94-4159-822b-44464d3bf4f2%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![ElasticSearch\_Users\_](https://avatars.discourse-cdn.com/v4/letter/e/b4bc9f/32.png) [@ElasticSearch\_Users\_](https://discuss.elastic.co/u/ElasticSearch_Users_)\
**Post date:** [May 30, 2014, 9:54pm UTC](https://discuss.elastic.co/t/script-field-coercion-out-of-range/17809/2 "2014-05-30T21:54:27Z")

</div>

Is it possible that you have different JDK versions? I tried this on 1.7u25  
and it gave me the error, but not on 1.7u55.

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/5e2ddba3-88f9-431b-9dc8-072eae7f5e39%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/5e2ddba3-88f9-431b-9dc8-072eae7f5e39%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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 6, 2017, 1:25am UTC](https://discuss.elastic.co/t/script-field-coercion-out-of-range/17809/3 "2017-07-06T01:25:35Z")

</div>

Closed on July 6, 2017, 1:25am UTC


