I will explain better with an example, if I have a function score like this:
"function_score": { "query": {}, "functions": [ { "filter": { "bool": { "must_not": [{ "term": { "field_A": 12345 } ] } }, "FUNCTION": { /* something here returns zero */ } }, { "filter": { "bool": { "must": [{ "term": { "field_A": 12345 } ] } }, "FUNCTION": { /* something here returns non-zero */ } }, "min_score" : 1
}
So the first function flattens the score of a negated filter to 0, while the second one applies a custom score function. The intersection between first filter and second filter is empty e.g. they are exclusive.
If I do not specify the filter in the second function, will Elasticsearch waste computations calculating a score that is already supposed to be discarded? e.g. do I need to specify that filter or no?