I have a tutors index in elastic search. I have stored all tutors data there. I want to make tie breaker query if two doc has same score in elasticsearch. Like if two tutor has same score then i want to display the tutor first which has more teaching hours, if that are also same then i want to display the tutor first which was registered first.
My index data is like below :
{
"_index": "tutors",
"_type": "tutors",
"_id": "1",
"_score": 1.2308,
"_source": {
"first_name": "Alessia",
"last_name": "Williams",
"slug": "alessia",
"verified": 1,
"approved": 1,
"total_teaching_hours": 105,
"registered_at": "2022-01-14T07:36:48.000000Z",
}
},
{
"_index": "tutors",
"_type": "tutors",
"_id": "2",
"_score": 1.2308,
"_source": {
"first_name": "Anika",
"last_name": "Rivera",
"slug": "anika",
"verified": 1,
"approved": 1,
"total_teaching_hours": 104,
"registered_at": "2022-02-14T07:36:48.000000Z",
}
},
{
"_index": "tutors",
"_type": "tutors",
"_id": "3",
"_score": 1.2308,
"_source": {
"first_name": "Anika",
"last_name": "Rivera",
"slug": "anika",
"verified": 1,
"approved": 1,
"total_teaching_hours": 105,
"registered_at": "2022-02-14T07:36:48.000000Z",
}
}