I have documents that look like this:
{
"parent" : {
"properties" : {
"id": {
"type" : "keyword"
}
"name" : {
"type" : "keyword"
}
}
}
}
and child documents:
{
"child": {
"_parent": {
"type": "parent"
},
"_routing": {
"required": true
},
"properties": {
"child_id": {
"type" : "keyword"
},
"child_name" : {
"type" : "keyword"
},
"child_time": {
"type": "date"
}
}
}
}
How can I sort parent documents by child_name with the last child_time?
source
share