# Optional field for boosting results score

**URL:** <https://discuss.elastic.co/t/optional-field-for-boosting-results-score/286805>\
**Category:** Elasticsearch\
**Created:** [October 15, 2021, 7:51am UTC](https://discuss.elastic.co/t/optional-field-for-boosting-results-score/286805 "2021-10-15T07:51:35Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sodium](https://avatars.discourse-cdn.com/v4/letter/s/3ec8ea/32.png) [@Sodium](https://discuss.elastic.co/u/Sodium)\
**Post date:** [October 15, 2021, 7:51am UTC](https://discuss.elastic.co/t/optional-field-for-boosting-results-score/286805/1 "2021-10-15T07:51:35Z")

</div>

Hello,

I currently have this request:

```auto

'query' => 
     'multi_match' => [
         'query' => $queryString,
         'type' => 'bool_prefix',
         'fields' => [
             'label^3',
             'categories_list',
              'tags_list',
          ],
          'operator' => 'and',
      ]
 ]

```

Which does what i want, for example if i type "quick brown fox" i want to match all this words using those 3 fields.

Now what i want is to have an additional field only for boosting the score, lets say it's name is "keyword". So "Cute quick brown fox" would have a higher score but "quick brown fox" would still match.

How can i achieve this ?

Thanks

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [October 15, 2021, 8:09am UTC](https://discuss.elastic.co/t/optional-field-for-boosting-results-score/286805/2 "2021-10-15T08:09:22Z")

</div>

You should start with a `bool` query.  
Put the `multi_match` part in the `must` array.  
And add a `should` array, where you can put a `match` query in.

---

<div class="post-metadata">

**Author:** ![Sodium](https://avatars.discourse-cdn.com/v4/letter/s/3ec8ea/32.png) [@Sodium](https://discuss.elastic.co/u/Sodium)\
**Post date:** [October 15, 2021, 11:01am UTC](https://discuss.elastic.co/t/optional-field-for-boosting-results-score/286805/3 "2021-10-15T11:01:18Z")

</div>

That did it thanks 🙂

---

<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:** [November 12, 2021, 11:02am UTC](https://discuss.elastic.co/t/optional-field-for-boosting-results-score/286805/4 "2021-11-12T11:02:12Z")

</div>

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