i had data as Below:
{
"data": [
{
"_index": "school",
"_type": "NestedSort",
"_id": "1",
"_score": 1,
"_source": {
"studentId": "1",
"student": [
{
"program": "Computer",
"type": "Student",
"value": 100
},
{
"program": "Architecture",
"type": "Student",
"value": 200
},
{
"program": "Civil",
"type": "Teacher",
"value": 150
}
]
}
},
{
"_index": "school",
"_type": "NestedSort",
"_id": "2",
"_score": 1,
"_source": {
"studentId": "2",
"student": [
{
"program": "Elex",
"type": "Student",
"value": 400
},
{
"program": "Computer",
"type": "Teacher",
"value": 250
},
{
"program": "Electronics",
"type": "Student",
"value": 150
}
]
}
},
{
"_index": "school",
"_type": "NestedSort",
"_id": "3",
"_score": 1,
"_source": {
"studentId": "3",
"student": [
{
"program": "Computer",
"type": "Teacher",
"value": 500
}
]
}
}
]
}
Now, when i try to sort by program field i.e Nested field (student.program), it doesnot give accurate result. Please Suggest for that case.