I have a type called jobdetails. The type contain professional experience related details of employees. Each employee document have an experience filed which is type nested.
"experience":
{
"type": "nested",
"properties":
{
"company": {
"type": "string"
},
"title":{
"type": "string"
}
}
}
I would like to know how to fetch employees having only “manager” or “teacher” but not “trainee” experience in their experience field.
For Ex:
doc 1: experience[
{“company”:“xxx”, “title”:”manager”},
{“company”:“xxx”, “title”:”teacher”},
{“company”:“xxx”, “title”:”trainee manager”},]
doc 2: experience[{“company”:“xxx”, “title”:”manager”}]
doc 3: experience[{“company”:“xxx”, “title”:”teacher”}]
doc 4: experience[
{“company”:“xxx”, “title”:”manager”},
{“company”:“xxx”, “title”:”teacher]
The required query should return doc2, doc3, doc4 but not doc1.