Hello All,
I am new in elasticsearch and straggle to get expected output and below is my query.
Here i basically looking to get all Employee in "organization" index whose name start with "jo" and also the employee who direct reportee to "Smith"(manager) that should come first and then rest of the employee whose name start with "jo".
if you could see in below organization index, all employee name start with "jo" but manager is different. so the employee which is direct reportee
to "smith" should come first then other employees in orgranisation whose name start with "jo".
organization Index script*********
POST organization/_doc/
{"employee" : "jonthan","gender" : "M", "department" : "manufacturing", "manager" : "kene"}
POST organization/_doc/
{"employee" : "jonty","gender" : "M", "department" : "digital", "manager" : "smith"}
POST organization/_doc/
{"employee" : "jolly","gender" : "M", "department" : "adming", "manager" : "mark"}
POST organization/_doc/
{"employee" : "john","gender" : "M", "department" : "digital", "manager" : "smith"}
POST organization/_doc/
{"employee" : "peter","gender" : "M", "department" : "digital", "manager" : "morgan"}
POST organization/_doc/
{"employee" : "steve","gender" : "M", "department" : "digital", "manager" : "morgan"}
So i am looking output something like this:
Output*
jonty
john
jonthan
jolly