# Multi match query boosting

**URL:** <https://discuss.elastic.co/t/multi-match-query-boosting/89258>\
**Category:** Elasticsearch\
**Created:** [June 13, 2017, 7:46pm UTC](https://discuss.elastic.co/t/multi-match-query-boosting/89258 "2017-06-13T19:46:15Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yur\_Gasparyan](https://avatars.discourse-cdn.com/v4/letter/y/7c8e57/32.png) [@Yur\_Gasparyan](https://discuss.elastic.co/u/Yur_Gasparyan)\
**Post date:** [June 13, 2017, 7:46pm UTC](https://discuss.elastic.co/t/multi-match-query-boosting/89258/1 "2017-06-13T19:46:15Z")

</div>

Hi all . Today I am going to use elasticsearch as I have sql query converted to es query, but there is an error associated with boosting. So I can not create multi match query where I can boost a filed result. I am doing search on title,body and name fileds and I want to give a priority to title , than to body , so saying I want to multply title result by 3 , body result by 1.5 and name result by 0.5. Please help me to create query . Thanks!

---

<div class="post-metadata">

**Author:** ![Ivan](https://avatars.discourse-cdn.com/v4/letter/i/df788c/32.png) [@Ivan](https://discuss.elastic.co/u/Ivan)\
**Post date:** [June 13, 2017, 8:16pm UTC](https://discuss.elastic.co/t/multi-match-query-boosting/89258/2 "2017-06-13T20:16:09Z")

</div>

The syntax for boost a field depends on the client you are using. The  
Elasticsearch documentation has a good example of how to boost a field when  
using JSON. From  
[https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-multi-match-query.html#\_literal\_fields\_literal\_and\_per\_field\_boosting](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-multi-match-query.html#_literal_fields_literal_and_per_field_boosting)

{  
"query": {  
"multi\_match" : {  
"query" : "this is a test",  
"fields" : ["subject^3", "message"]  
}  
}  
}

In that example, the subject field is boost by 3, while the message remains  
unboosted.

Note that the default type is "best\_fields", which means the score will be  
for the highest scoring field. If you want to sum the scores of all the  
fields as a final result, set the type to "most\_fields"  
[https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-multi-match-query.html#multi-match-types](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-multi-match-query.html#multi-match-types)

Cheers,

Ivan

---

<div class="post-metadata">

**Author:** ![Yur\_Gasparyan](https://avatars.discourse-cdn.com/v4/letter/y/7c8e57/32.png) [@Yur\_Gasparyan](https://discuss.elastic.co/u/Yur_Gasparyan)\
**Post date:** [June 20, 2017, 9:01pm UTC](https://discuss.elastic.co/t/multi-match-query-boosting/89258/3 "2017-06-20T21:01:08Z")

</div>

I have already got the solution . Thank you very much!

---

<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:** [July 18, 2017, 9:01pm UTC](https://discuss.elastic.co/t/multi-match-query-boosting/89258/4 "2017-07-18T21:01:14Z")

</div>

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