I have an index where documents will be of two types such as Type1 and Type2
{
{ "id":1,
"SourceType": "Type1",
"ItemNumber": "AS5888",
"AgreementNumber": null
}
{
"id":2,
"SourceType": "Type2",
"ItemNumber": "AS5888",
"AgreementNumber": "Agreement1"
}
{
"id":3,
"SourceType": "Type2",
"ItemNumber": "AS5888",
"AgreementNumber": "Agreement2"
}
{
"id":4,
"SourceType": "Type1",
"ItemNumber": "AS5889",
"AgreementNumber": null
}
}
If i search for "AS5888", only it should return type2 documents(id 2 and 3).
If i search for "AS5889", then it should return type1 documents(id 4) because type2 document is not present.
When we search, the type1 document should return only if type2 document is not present.