# Use query match only to boost and don't increase the recall set

**URL:** <https://discuss.elastic.co/t/use-query-match-only-to-boost-and-dont-increase-the-recall-set/278385>\
**Category:** Elasticsearch\
**Created:** [July 12, 2021, 7:40am UTC](https://discuss.elastic.co/t/use-query-match-only-to-boost-and-dont-increase-the-recall-set/278385 "2021-07-12T07:40:02Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bikas\_Katwal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bikas_katwal/32/82111_2.png) [@Bikas\_Katwal](https://discuss.elastic.co/u/Bikas_Katwal)\
**Post date:** [July 12, 2021, 7:40am UTC](https://discuss.elastic.co/t/use-query-match-only-to-boost-and-dont-increase-the-recall-set/278385/1 "2021-07-12T07:40:02Z")

</div>

I have multiple match queries inside the `should` clause. I would like to add another field match, which should be used only to boost scores and not increase the recall set.  
I have the below query that is being used currently:

```auto
{
  "query": {
    "function_score": {
      "query": {
        "bool": {
          "minimum_should_match": 1,
          "should": [
            {
              "multi_match": {
                "minimum_should_match": "2<50%",
                "query": "cadbury sugar free chocolate",
                "type": "best_fields",
                "fields": [
                  "name^10",
                  "description^5"
                ],
                "tie_breaker": 1
              }
            },
            {
              "term": {
                "name.raw": {
                  "value": "cadbury sugar free chocolate",
                  "boost": 10
                }
              }
            },
            {
              "nested": {some nested should query}
            },
            {
              "nested": {some nested should query 2}
            }
          ]
        }
      },
      "functions": [
        {some function boost},
        {some function boost 2}
      ],
      "score_mode": "sum",
      "boost_mode": "sum"
    }
  },
  "from": 0,
  "size": 20
}

```

As you can see I have 4 matches in `should` among them, either one match is mandatory for a document to be relevant.

Now I need to introduce a new field `brand`. From the above result set all the documents should be boosted that have `brand:cadbury` but should not extract any new document that matches this condition.  
I tried adding one more match(with boost) inside `should` for the brand field, but this increases my recall set.

How do I solve this?

---

<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:** [August 9, 2021, 7:40am UTC](https://discuss.elastic.co/t/use-query-match-only-to-boost-and-dont-increase-the-recall-set/278385/2 "2021-08-09T07:40:32Z")

</div>

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