Sorting results on multiple fields


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
To view this discussion on the web visit
For more options, visit