Is it possible to Sort all the docs nested field together, If yes, then how

#Problem: we want to sort completionTimeStamp of all the docs together. Not a single document wise, but whole document wise.

DELETE my_index
PUT my_index
{
"mappings": {
"doc": {
"properties": {
"courses": {
"type": "nested",
"properties": {
"completionTimeStamp": {
"type": "date"
}
}
},
"fullNameId": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
}
}
}
}
}

GET my_index/_mapping

PUT my_index/doc/101
{
"fullNameId": "Antonio Neloms",
"courses": [
{
"completionTimeStamp": "2015-02-01T08:00:00.000Z"
},
{
"completionTimeStamp": "2018-06-10T08:00:00.000Z"
}
]
}
PUT my_index/doc/102
{
"fullNameId": "Danny Rocks",
"courses": [
{
"completionTimeStamp": "2015-08-01T08:00:00.000Z"
},
{
"completionTimeStamp": "2017-06-10T08:00:00.000Z"
}
,
{
"completionTimeStamp": "2016-07-10T08:00:00.000Z"
}
]
}

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