# Sorting results on multiple fields

**URL:** <https://discuss.elastic.co/t/sorting-results-on-multiple-fields/19863>\
**Category:** Elasticsearch\
**Created:** [September 18, 2014, 10:08am UTC](https://discuss.elastic.co/t/sorting-results-on-multiple-fields/19863 "2014-09-18T10:08:16Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Richard\_Lynch](https://avatars.discourse-cdn.com/v4/letter/r/898d66/32.png) [@Richard\_Lynch](https://discuss.elastic.co/u/Richard_Lynch)\
**Post date:** [September 18, 2014, 10:08am UTC](https://discuss.elastic.co/t/sorting-results-on-multiple-fields/19863/1 "2014-09-18T10:08:16Z")

</div>

Hi,

I'm having trouble sorting my results which has multiple types with  
different fields (where each field doesn't exist on the other type).

This is my request:

{  
"from": 0,  
"size": 12,  
"sort": {  
"learnArticlePostedDate": "desc",  
"publicationDate": "desc"  
}  
}

The results that are returned are a combination of the two different types  
(Article and Publication) where one type has the field  
"learnArticlePostedDate" but not "publicationDate" and the other type has  
the field "publicationDate" but not "learnArticlePostedDate".

The problem I'm having is that my results set is returning firstly with all  
the Article types ordered by Date descending and then secondly by the  
Publication types ordered by Date descending.

I would simply like my results set to be ordered by date - even though the  
date property is different per item in the results.

Can anyone help please?

Many thanks  
Rick Lynch

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/d378ef6f-b701-45e2-a624-c244ce832a2e%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/d378ef6f-b701-45e2-a624-c244ce832a2e%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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, 1:01am UTC](https://discuss.elastic.co/t/sorting-results-on-multiple-fields/19863/2 "2017-07-06T01:01:19Z")

</div>


