# Sort by value of array object

**URL:** <https://discuss.elastic.co/t/sort-by-value-of-array-object/12238>\
**Category:** Elasticsearch\
**Created:** [June 3, 2013, 4:29pm UTC](https://discuss.elastic.co/t/sort-by-value-of-array-object/12238 "2013-06-03T16:29:40Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Patrik\_Votocek](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/patrik_votocek/32/2027_2.png) [@Patrik\_Votocek](https://discuss.elastic.co/u/Patrik_Votocek)\
**Post date:** [June 3, 2013, 4:29pm UTC](https://discuss.elastic.co/t/sort-by-value-of-array-object/12238/1 "2013-06-03T16:29:40Z")

</div>

Hi a have this document:

'doc': {  
'categories': [  
{'id': 1, position: 1},  
{'id': 2, position: 5}  
]  
}

and i need sort results by `category.position` with specific `category.id`  
is it possible?

Patrik

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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, 2:33am UTC](https://discuss.elastic.co/t/sort-by-value-of-array-object/12238/2 "2017-07-06T02:33:16Z")

</div>


