I have three documents:
Doc 1: {
"DEPLOYMENT_NAME": "PaymentEngine_Release_01",
"buildingBlockName": "GIOM-TAN-BW"
}
Doc 2: {
"DEPLOYMENT_NAME": "ProxyXFBAdapter_01",
"buildingBlockName": "GIOM-TAN-BW"
}
Doc 3: {
"OTHER_TERM": "VALUE1",
"buildingBlockName": "GIOM-TAN",
}
The mapping of these fields is simple string (default) [ which means there is no specific setting saying NOT_ANALYZED ]
I would like to get only those documents where buildingBlockName = "GIOM-TAN-BW" and DEPLOYMENT_NAME NOT equal to PaymentEngine_Release_01, which means only DOC 1
I have tried quite a few combinations of MUST_NOT, EXIST, BOOL but some how not able to skip DOC 2 and ONLY GET DOC1.
Following query restricts DOC 3 but returns both DOC 1 and DOC 2, while I wanted only DOC 1 to return
GET /giom/_search
{
"query": {
"filtered": {
"query": {
"bool": {
"must_not": [
{
"term": {
"DEPLOYMENT_NAME": {
"value": "CustomerFile_Initiate_01"
}
}
}
]
}
},
"filter": {
"exists": {
"field": "DEPLOYMENT_NAME"
}
}
}
}
}
Please help ... i am suspecting it has to do with String Analyzer which is not allowing MUST_NOT to work ... but ##$@#