# How get not sorted value of array field

**URL:** <https://discuss.elastic.co/t/how-get-not-sorted-value-of-array-field/98434>\
**Category:** Elasticsearch\
**Created:** [August 26, 2017, 5:08am UTC](https://discuss.elastic.co/t/how-get-not-sorted-value-of-array-field/98434 "2017-08-26T05:08:22Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![clark010](https://avatars.discourse-cdn.com/v4/letter/c/7c8e57/32.png) [@clark010](https://discuss.elastic.co/u/clark010)\
**Post date:** [August 26, 2017, 5:08am UTC](https://discuss.elastic.co/t/how-get-not-sorted-value-of-array-field/98434/1 "2017-08-26T05:08:23Z")

</div>

Hi,  
i write a score script, and used doc().getOrDefault() api to get the value of array field, but i found the result is sorted, so i just can get the original value of this field from source().get() api, but i know this is high latency.  
are there a way to get original value from doc() api or other ways?

---

<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:** [September 23, 2017, 5:08am UTC](https://discuss.elastic.co/t/how-get-not-sorted-value-of-array-field/98434/2 "2017-09-23T05:08:38Z")

</div>

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