Hi Aaron,
Thanks for your reply! But it is not about filtering, should or must or must_not. It is not what I want to achieve, I tried all these options, didn't get the result i wanted. I want to know if "not_exist" is supported?
I explained a bit on my scenario below, I have some ES doc that contains different fields, some with null values, some with values. I want to get the count of the field for "not_exists" values. Please check my example below.
Wanted Behavior
"bool": {
"should": [
{
"not_exists": {
"field": "queue_event_id"
}
},
{
"not_exists": {
"field": "start_event_id"
}
},
{
"not_exists": {
"field": "finish_event_id"
}
}
]
}
Elastic Search Documents Example
ES doc1
domain_id = host123
queue_event_id = a123
start_event_id = a234
finish_event_id = a345
ES doc2
domain_id = host123
queue_event_id = b123
start_event_id = b234
finish_event_id = b345
ES doc3
domain_id = host123
queue_event_id = null
start_event_id = c234
finish_event_id = null
ES doc4
domain_id = host123
queue_event_id = d123
start_event_id = null
finish_event_id = null
My Kibana Graph Configuration
I have 3 y axis in my graph
y1-uniquecount (queue_event_id)
y2-uniquecount (start_event_id)
y3-uniquecount (finish_event_id)
x axis
x-singnificant term (domain_id)
My Expected Result
expected result for those id that contains "null" value for domain host123 is
number of not_exist --- queue_event_id = 1
number of not_exist --- start_event_id = 1
number of not_exist --- finish_event_id = 2
The query below with "must_not" will give me 0 result for everything, since it is AND condition. If I want to use "should" condition, then I need a "not_exists" tag , but not_exist tag is not supported
{
"query": {
"bool": {
"must_not": [
{
"exists": {
"field": "queue_event_id"
}
},
{
"exists": {
"field": "start_event_id"
}
},
{
"exists": {
"field": "finish_event_id"
}
}
]
}
}
}