# Distinguishing hybrid search results

**URL:** https://discuss.elastic.co/t/distinguishing-hybrid-search-results/344086
**Category:** Elasticsearch
**Tags:** vector-search
**Created:** [September 28, 2023, 4:39pm UTC](https://discuss.elastic.co/t/distinguishing-hybrid-search-results/344086 "2023-09-28T16:39:11Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Gabor\_Gergely](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gabor_gergely/32/102396_2.png) [@Gabor\_Gergely](https://discuss.elastic.co/u/Gabor_Gergely)
#### Post date: [September 28, 2023, 4:39pm UTC](https://discuss.elastic.co/t/distinguishing-hybrid-search-results/344086/1 "2023-09-28T16:39:11Z")

</div>

Hi Folks,

I perform hybrid search by providing both the knn and a query, like the example in the Elasticsearch Guide:

```auto
POST image-index/_search
{
  "query": {
    "match": {
      "title": {
        "query": "mountain lake",
        "boost": 0.9
      }
    }
  },
  "knn": {
    "field": "image-vector",
    "query_vector": [54, 10, -2],
    "k": 5,
    "num_candidates": 50,
    "boost": 0.1
  },
  "size": 10
}

```

Is there any way (other than running the search with explain: true) to distinguish the results according to which search (query, knn or both) found it?

Thanks&Regards,

---

<div class="post-metadata">

### Author: ![Priscilla\_Parodi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/priscilla_parodi/32/43047_2.png) [@Priscilla\_Parodi](https://discuss.elastic.co/u/Priscilla_Parodi)
#### Post date: [September 30, 2023, 11:05pm UTC](https://discuss.elastic.co/t/distinguishing-hybrid-search-results/344086/2 "2023-09-30T23:05:51Z")

</div>

Hello @Gabor_Gergely,

In this case, for linear combination the score of each hit is the sum of the `knn` and `query` scores.

`score = 0.9 * match_score + 0.1 * knn_score`

In other words, you can check the scores to understand the results.

---

<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: [October 2, 2023, 12:14pm UTC](https://discuss.elastic.co/t/distinguishing-hybrid-search-results/344086/3 "2023-10-02T12:14:18Z")

</div>

Right now @Gabor_Gergely, for a significantly complicated query, the only way is `explain: true`.

I realize this isn't the best option. Regular queries have `_name` to help with this. Right now `knn` has no such option.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [October 30, 2023, 12:14pm UTC](https://discuss.elastic.co/t/distinguishing-hybrid-search-results/344086/4 "2023-10-30T12:14:59Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
