Hi there,
I'm wondering, if there is any performance gain using must_not
clause over to query_string
using NOT
operator (will be used inside filter
and should
clause).
query_string
has obviously shorter scripture, no relevance score needed.
must_not:
{
"bool": {
"must_not": [
{
"term": {
"fieldA": {
"value": "XYZ"
}
}
}
]
}
}
query_string:
{
"query_string": {
"default_field": "fieldA",
"query": "NOT XYZ"
}
}
FieldA is a keyword.
Thanks