Hi,
We are investigating some slow queries in our Prod environment. We saw that the following filter is much slower than other term queries in query / filter section.
"query": {
"bool": {
"must": {…},
"filter" : {
"should": [
{
"bool": {
"must_not": [
{
"exists": {
"field": "isDiscussionOnly"
}
}
]
}
},
{
"terms": {
"isDiscussionOnly": [
"false"
]
}
}
]
}
}
}
Is there any known performance issue / performance guideline around using must_not with exists.
Would it help to always have this field set (with some default value) and replace the above filter with term query filter?