Modify default scoring convention for multi field knn search to omit null values

Hi,

With multi field knn search, the score is calculated, e.g.

score = match_boost * match_score + field1_boost * field1_score + field2_boost * field2_score

If a document is missing the vector value for a field, the field score is 0.

Is there a way to modify the score to omit the missing values from the score calculation? i.e., if a document is missing field1,

score = match_score + field2_boost * field2_score

and if it is missing both fields, it would be

score = match_score

Thanks,
Travis

@tlandelin

Maybe I don't understand the question, but having a _score=0 is the same as not having the score at all.

0 * x = 0 (so the boost and everything has no effect) and 0 + x = x (summing the scores, 0 means nothing).