# Why sorted by an integer field,then some result throwed exception

**URL:** <https://discuss.elastic.co/t/why-sorted-by-an-integer-field-then-some-result-throwed-exception/37309>\
**Category:** Elasticsearch\
**Created:** [December 16, 2015, 6:43am UTC](https://discuss.elastic.co/t/why-sorted-by-an-integer-field-then-some-result-throwed-exception/37309 "2015-12-16T06:43:15Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![kliwin](https://avatars.discourse-cdn.com/v4/letter/k/3bc359/32.png) [@kliwin](https://discuss.elastic.co/u/kliwin)\
**Post date:** [December 16, 2015, 6:43am UTC](https://discuss.elastic.co/t/why-sorted-by-an-integer-field-then-some-result-throwed-exception/37309/1 "2015-12-16T06:43:15Z")

</div>

Hi,  
I have a type :  
{"column":{"properties":{"STATUS\_STOP":{"type":"long"},"STATUS\_USE":{"type":"long"},"alis":{"type":"string"},"comment":{"properties":{"audit":{"type":"string"},"enable":{"type":"string"}}},"content":{"type":"string"},"dataSource":{"type":"string"},"deivceType":{"type":"string"},"description":{"type":"string"},"deviceType":{"type":"string"},"dms\_position":{"type":"long"},"homePage":{"type":"string"},"name":{"type":"string"},"newestPeriod":{"type":"string"},"parent":{"type":"string"},"parentPath":{"type":"string"},"position":{"type":"integer"},"status":{"type":"long"},"template":{"type":"string"},"thumbnail":{"type":"string"},"type":{"type":"string"}}}}  
there is an integer field call "position",sometimes sorted by this field that some result throwed "NumberFormatException[Invalid shift value in prefixCoded bytes (is encoded value really an INT?".The first time I found there is another mapping had the "position" field but type is string, I change another mapping to solve the problem, but soon, I found the problem second time, and I can't find how to solve it.I checked the result that the value of "position" is 0, but the exception said the value is long type, why?

Thanks!

---

<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 5, 2017, 11:30pm UTC](https://discuss.elastic.co/t/why-sorted-by-an-integer-field-then-some-result-throwed-exception/37309/2 "2017-07-05T23:30:44Z")

</div>


