I have the following query in ElasticSearch. I am trying to filter out documents where the field message_class
equals 'SE'.
I have referred to this SO Q&A, amongst other things, but the query below still returns documents that have the field message_class
equaling 'SE'.
What is the correct way to use the not
filter?
POST _search
{
"query":{
"filtered":{
"filter":{
"not":{
"term":{
"message_class":"SE"
}
}
}
}
}
}
The _mapping
for the field message_class
shows:
"message_class" : {
"full_name" : "message_class", "mapping" : {"message_class":{"type":"string"}}
}