# Multi Match Query boosting fields

**URL:** <https://discuss.elastic.co/t/multi-match-query-boosting-fields/23543>\
**Category:** Elasticsearch\
**Created:** [May 4, 2015, 3:41pm UTC](https://discuss.elastic.co/t/multi-match-query-boosting-fields/23543 "2015-05-04T15:41:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kirill](https://avatars.discourse-cdn.com/v4/letter/k/a9a28c/32.png) [@Kirill](https://discuss.elastic.co/u/Kirill)\
**Post date:** [May 4, 2015, 3:41pm UTC](https://discuss.elastic.co/t/multi-match-query-boosting-fields/23543/1 "2015-05-04T15:41:09Z")

</div>

Hi,  
My question is related to boosting fields in Multi Match Query.  
I have 3 fields: First name, Second name and description. A want the score  
to be low, when it matches description field.  
{  
"function\_score" : {  
"query" : {  
"bool" : {  
"must" : [ {  
"multi\_match" : {  
"query" : "te",  
"fields" : ["description", "name^10", "second\_name^20"],  
"type" : "phrase\_prefix",  
"prefix\_length" : 2,  
}  
}, {  
"multi\_match" : {  
"query" : "test",  
"fields" : ["description", "name^10", "second\_name^10"],  
"type" : "cross\_fields",  
"operator" : "AND"  
}  
} ]  
}  
},  
}  
}

But I mentioned that score doesn't change at all when I change boosting  
variables(10 or 20). Is there is a way to create smart function, that  
gives low score to objects that matches description field? Thank you in  
advance.

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/29b352f7-e38a-442b-8653-35e66ced4423%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/29b352f7-e38a-442b-8653-35e66ced4423%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Allan\_Mitchell](https://avatars.discourse-cdn.com/v4/letter/a/edb3f5/32.png) [@Allan\_Mitchell](https://discuss.elastic.co/u/Allan_Mitchell)\
**Post date:** [May 5, 2015, 4:05pm UTC](https://discuss.elastic.co/t/multi-match-query-boosting-fields/23543/2 "2015-05-05T16:05:54Z")

</div>

Hi

Are you looking for something like this? It certainly orders correctly in  
the results.

PUT multitest

POST /multitest/books/1  
{  
"title" : "The Fox",  
"Description": "Mixing things around",  
"Category" : "books"  
}  
POST /multitest/books/2  
{  
"title" : "A different title",  
"Description": "all about a fox",  
"Category" : "books"  
}  
POST /multitest/books/3  
{  
"title" : "a different title",  
"Description": "not about animals",  
"Category" : "Fox"  
}

GET /multitest/\_search  
{  
"query": {  
"multi\_match": {  
"query": "Fox",  
"fields": ["title^0.5", "Description^2", "Category^3"]  
}  
}  
}

Allan

On 4 May 2015 at 16:41, Kirill [kzhdanovich@gmail.com](mailto:kzhdanovich@gmail.com) wrote:

> Hi,  
> My question is related to boosting fields in Multi Match Query.  
> I have 3 fields: First name, Second name and description. A want the score  
> to be low, when it matches description field.  
> {  
> "function\_score" : {  
> "query" : {  
> "bool" : {  
> "must" : [ {  
> "multi\_match" : {  
> "query" : "te",  
> "fields" : ["description", "name^10", "second\_name^20"],  
> "type" : "phrase\_prefix",  
> "prefix\_length" : 2,  
> }  
> }, {  
> "multi\_match" : {  
> "query" : "test",  
> "fields" : ["description", "name^10", "second\_name^10"],  
> "type" : "cross\_fields",  
> "operator" : "AND"  
> }  
> } ]  
> }  
> },  
> }  
> }
> 
> But I mentioned that score doesn't change at all when I change boosting  
> variables(10 or 20). Is there is a way to create smart function, that  
> gives low score to objects that matches description field? Thank you in  
> advance.
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/29b352f7-e38a-442b-8653-35e66ced4423%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/29b352f7-e38a-442b-8653-35e66ced4423%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/29b352f7-e38a-442b-8653-35e66ced4423%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/29b352f7-e38a-442b-8653-35e66ced4423%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

## -- Please update your bookmarks! We moved to [https://discuss.elastic.co/](https://discuss.elastic.co/)

You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAECdJzAM9sC%3DxY8Y1w4jB43geyJ1WnxCpX54Y9pAe1DAjXtLQw%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAECdJzAM9sC%3DxY8Y1w4jB43geyJ1WnxCpX54Y9pAe1DAjXtLQw%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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 6, 2017, 12:15am UTC](https://discuss.elastic.co/t/multi-match-query-boosting-fields/23543/3 "2017-07-06T00:15:35Z")

</div>


