# Sort in both parent and child objects

**URL:** <https://discuss.elastic.co/t/sort-in-both-parent-and-child-objects/119614>\
**Category:** Elasticsearch\
**Created:** [February 13, 2018, 10:40am UTC](https://discuss.elastic.co/t/sort-in-both-parent-and-child-objects/119614 "2018-02-13T10:40:19Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![muthucse123](https://avatars.discourse-cdn.com/v4/letter/m/6de8d8/32.png) [@muthucse123](https://discuss.elastic.co/u/muthucse123)\
**Post date:** [February 13, 2018, 10:40am UTC](https://discuss.elastic.co/t/sort-in-both-parent-and-child-objects/119614/1 "2018-02-13T10:40:19Z")

</div>

i have parent child mapping to store the media content. I need to sort using both parent and child fields when querying. Is it possible to sort in both parent and child ? I tried and there is no option to sort both.

When i sort the child document it should be compared across the documents not within the inner documents.

---

<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:** [March 13, 2018, 10:40am UTC](https://discuss.elastic.co/t/sort-in-both-parent-and-child-objects/119614/2 "2018-03-13T10:40:24Z")

</div>

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