# Sorting Question

**URL:** <https://discuss.elastic.co/t/sorting-question/12511>\
**Category:** Elasticsearch\
**Created:** [June 21, 2013, 2:37pm UTC](https://discuss.elastic.co/t/sorting-question/12511 "2013-06-21T14:37:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![japicka](https://avatars.discourse-cdn.com/v4/letter/j/7993a0/32.png) [@japicka](https://discuss.elastic.co/u/japicka)\
**Post date:** [June 21, 2013, 2:37pm UTC](https://discuss.elastic.co/t/sorting-question/12511/1 "2013-06-21T14:37:46Z")

</div>

This is the JSON that I have to sort my index

"sort" : { "\_score" : {} , "updated" : { "order" : "desc" } }

Where this works it pretty much only pays attention to the first sort field, so if \_score is first that is the sort, and the dates on the results coming back are _not_ sorted in date order. If I reverse the JSON to be this:

"sort" : {"updated" : { "order" : "desc" }, "\_score" : {} }

The reverse is pretty much true. Is there a way to basically sort by \_score highest to lowest then within that score by my date field "updated" newest to oldest?

I am thinking a nested sort might accomplish this, but I may be wrong here.

---

<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:29am UTC](https://discuss.elastic.co/t/sorting-question/12511/2 "2017-07-06T02:29:58Z")

</div>


