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

**URL:** <https://discuss.elastic.co/t/modify-default-scoring-convention-for-multi-field-knn-search-to-omit-null-values/359287>\
**Category:** Elasticsearch\
**Tags:** vector-search\
**Created:** [May 10, 2024, 11:28pm UTC](https://discuss.elastic.co/t/modify-default-scoring-convention-for-multi-field-knn-search-to-omit-null-values/359287 "2024-05-10T23:28:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![tlandelin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tlandelin/32/61497_2.png) [@tlandelin](https://discuss.elastic.co/u/tlandelin)\
**Post date:** [May 10, 2024, 11:28pm UTC](https://discuss.elastic.co/t/modify-default-scoring-convention-for-multi-field-knn-search-to-omit-null-values/359287/1 "2024-05-10T23:28:41Z")

</div>

Hi,

With [multi field knn search](https://www.elastic.co/guide/en/elasticsearch/reference/current/knn-search.html#_search_multiple_knn_fields), 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

---

<div class="post-metadata">

**Author:** ![BenTrent](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bentrent/32/33915_2.png) [@BenTrent](https://discuss.elastic.co/u/BenTrent)\
**Post date:** [May 13, 2024, 11:19am UTC](https://discuss.elastic.co/t/modify-default-scoring-convention-for-multi-field-knn-search-to-omit-null-values/359287/2 "2024-05-13T11:19:53Z")

</div>

@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).
