# Comparison of performance on sorting vs. scoring on date field

**URL:** <https://discuss.elastic.co/t/comparison-of-performance-on-sorting-vs-scoring-on-date-field/124001>\
**Category:** Elasticsearch\
**Created:** [March 14, 2018, 10:00pm UTC](https://discuss.elastic.co/t/comparison-of-performance-on-sorting-vs-scoring-on-date-field/124001 "2018-03-14T22:00:30Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Chris\_Gatihi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/chris_gatihi/32/25820_2.png) [@Chris\_Gatihi](https://discuss.elastic.co/u/Chris_Gatihi)\
**Post date:** [March 14, 2018, 10:00pm UTC](https://discuss.elastic.co/t/comparison-of-performance-on-sorting-vs-scoring-on-date-field/124001/1 "2018-03-14T22:00:30Z")

</div>

Since results are ordered by relevance by default when performing a search in ES, I have at least two options to obtain a sorted result set if I want to sort by a date field in descending order:

1. I can do an explicit sort with descending order
2. I can use a custom scoring function using a decay function on the date field with "now" as the origin

Does one of these options consistently perform better than the other? If so, why?

---

<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:** [April 11, 2018, 10:00pm UTC](https://discuss.elastic.co/t/comparison-of-performance-on-sorting-vs-scoring-on-date-field/124001/2 "2018-04-11T22:00:30Z")

</div>

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