# Normalizing knn and multi\_match clauses

**URL:** <https://discuss.elastic.co/t/normalizing-knn-and-multi-match-clauses/372307>\
**Category:** Elasticsearch\
**Tags:** vector-search\
**Created:** [December 22, 2024, 5:04pm UTC](https://discuss.elastic.co/t/normalizing-knn-and-multi-match-clauses/372307 "2024-12-22T17:04:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Itay\_Bittan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/itay_bittan/32/23527_2.png) [@Itay\_Bittan](https://discuss.elastic.co/u/Itay_Bittan)\
**Post date:** [December 22, 2024, 5:04pm UTC](https://discuss.elastic.co/t/normalizing-knn-and-multi-match-clauses/372307/1 "2024-12-22T17:04:50Z")

</div>

I have a product catalog as Elasticsearch (8.16.1) index.  
Each doc represent a product with different fields, such as name, color, etc.  
I've added a vector as additional field to each product / doc.

My search is can be a free text, such as "red dress".  
I am transforming this free text to vector and find the closest products with `knn` query which works great and return relevant products with 0 \< `_score` \< 1.0.

I am also querying with `multi_match` that works great but provide `_score` with unknown range (somewhere between 0 \< `_score` \< 25.0, but I can't point what the highest value is).

I want to combine those two approaches together, with an equal weight (or kind of control boost value) between knn and multi\_match.

Since the knn has a lower `_score` range (top 1.0) - the impact of its result is negligible and the multi\_match impact too much.

Here is my query, how can I change it / improve it to get the the same contribution for the knn and the multi\_match?

```auto
{
  "bool": {
    "should": [
      {
        "knn": {
          "field": "embedding_vector",
          "query_vector": [
            1,
            2,
            3
          ],
          "num_candidates": 10000,
          "filter": [
            {
              "term": {
                "categories.keyword": "Dresses"
              }
            }
          ]
        }
      },
      {
        "multi_match": {
          "query": "red dress",
          "fields": [
            "categories",
            "name",
            "color"
          ],
          "fuzziness": "AUTO",
          "type": "best_fields"
        }
      }
    ]
  }
}

```

Thanks!

---

<div class="post-metadata">

**Author:** ![Kathleen\_DeRusso](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kathleen_derusso/32/132039_2.png) [@Kathleen\_DeRusso](https://discuss.elastic.co/u/Kathleen_DeRusso)\
**Post date:** [January 2, 2025, 1:40pm UTC](https://discuss.elastic.co/t/normalizing-knn-and-multi-match-clauses/372307/2 "2025-01-02T13:40:37Z")

</div>

Hey there @Itay_Bittan this is a hard problem with hybrid search!

Using traditional query DSL the way to do this is through linear boosting - boost each clause accordingly. However, as you know scores can vary widely between different queries so this is not a great solution, and requires a lot of tuning.

You may be interested in [RRF](https://www.elastic.co/guide/en/elasticsearch/reference/current/rrf.html) which will combine results with such score disparities.
