Reputation: 6236
{
"size": 0,
"query": {
"bool": {
"must": [
{
"match": {
"cid": {
"query": "AFM"
}
}
},
{
"match": {
"web_code": "P"
}
}
],
"filter": [
{
"not": { // "type": "parsing_exception","reason": "unknown query [not]"
"term": {
"web_code": "PS"
}
}
}
]
}
}
}
Upvotes: 0
Views: 43
Reputation: 217474
You simply need to use the bool/must_not
query:
{
"size": 0,
"query": {
"bool": {
"must": [
{
"match": {
"cid": {
"query": "AFM"
}
}
},
{
"match": {
"web_code.keyword": "P"
}
}
],
"must_not": [
{
"term": {
"web_code.keyword": "PS"
}
}
]
}
}
}
Upvotes: 1