I need to add missing
filter to ES query bool
.
I tried to add directly to bool
and I got no query registered for [missing]
.
Then I added filter
and got no query registered for [filter]
.
I see many StackOverflow questions, and in many this works. Query example:
{
"bool": {
"must": [{
"missing": {
"field": "firstname"
}
}]
}
}
ES version 1.5.2
Looks like missing filter is being removed in elastic 5.x. I was told not to use it: https://www.elastic.co/guide/en/elasticsearch/reference/5.x/query-dsl-exists-query.html#_literal_missing_literal_query
Do this instead
GET /_search
{
"query": {
"bool": {
"must_not": {
"exists": {
"field": "firstname"
}
}
}
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With