# What is the use of Boost in elastic search?

**URL:** <https://discuss.elastic.co/t/what-is-the-use-of-boost-in-elastic-search/51947>\
**Category:** Elasticsearch\
**Created:** [June 6, 2016, 1:09pm UTC](https://discuss.elastic.co/t/what-is-the-use-of-boost-in-elastic-search/51947 "2016-06-06T13:09:41Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![taruntyagi94](https://avatars.discourse-cdn.com/v4/letter/t/ac91a4/32.png) [@taruntyagi94](https://discuss.elastic.co/u/taruntyagi94)\
**Post date:** [June 6, 2016, 1:09pm UTC](https://discuss.elastic.co/t/what-is-the-use-of-boost-in-elastic-search/51947/1 "2016-06-06T13:09:41Z")

</div>

Hello,

Please explain use of query time boosting in elastic search.

---

<div class="post-metadata">

**Author:** ![nik9000](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nik9000/32/44947_2.png) [@nik9000](https://discuss.elastic.co/u/nik9000)\
**Post date:** [June 6, 2016, 1:26pm UTC](https://discuss.elastic.co/t/what-is-the-use-of-boost-in-elastic-search/51947/2 "2016-06-06T13:26:22Z")

</div>

Is [https://www.elastic.co/guide/en/elasticsearch/guide/current/query-time-boosting.html](https://www.elastic.co/guide/en/elasticsearch/guide/current/query-time-boosting.html) enough?

---

<div class="post-metadata">

**Author:** ![taruntyagi94](https://avatars.discourse-cdn.com/v4/letter/t/ac91a4/32.png) [@taruntyagi94](https://discuss.elastic.co/u/taruntyagi94)\
**Post date:** [June 6, 2016, 1:39pm UTC](https://discuss.elastic.co/t/what-is-the-use-of-boost-in-elastic-search/51947/3 "2016-06-06T13:39:47Z")

</div>

thanks for valuable reply

but it is not working in my case.

post requst [http://localhost:9200/hospitalsdev/hospitals/\_search?size=10000&from=0](http://localhost:9200/hospitalsdev/hospitals/_search?size=10000&from=0)

{  
"query": {  
"bool": {  
"should": [  
{ "match": { "providerName": {"query":"amit","operator":"and","boost": 6} }},  
{ "match": { "email": {"query":"amit","operator":"and","boost": 5} }},  
{ "match": { "website": {"query":"amit","operator":"and","boost": 4} }}

```
  ]
}

```

}  
}

this query means first give priority providerName than email than website.

it gives this result and not give priority to providerName . In first record providerName not have amit but it on first place.

{  
"took": 4,  
"timed\_out": false,  
"\_shards": {  
"total": 5,  
"successful": 5,  
"failed": 0  
},  
"hits": {  
"total": 15,  
"max\_score": 1.4952936,  
"hits": [  
{  
"\_index": "hospitalsdev",  
"\_type": "hospitals",  
"\_id": "572b602929ead4c598b1b269",  
"\_score": 1.4952936,  
"\_source": {  
"\_id": "572b602929ead4c598b1b269",  
"email": "amit.singh3@gmail.com",  
"emergencyNumber": "",  
"faxNumber": "0",  
"telephoneNumber": "2650585/2652585",  
"stdCode": "135",  
"state": "Uttaranchal",  
"city": "Dehradun",  
"pinCode": "248001",  
"addressArea": "",  
"address2": "E.C.Road",  
"address1": "122/I",  
"providerName": "AMRITSAR EYE CLINIC",  
"providerNumber": 37018  
}  
},  
{  
"\_index": "hospitalsdev",  
"\_type": "hospitals",  
"\_id": "572b602929ead4c598b1ac4f",  
"\_score": 1.458293,  
"\_source": {  
"\_id": "572b602929ead4c598b1ac4f",  
"email": "amit.prakash728@gmail.com",  
"emergencyNumber": "",  
"faxNumber": "-",  
"telephoneNumber": "9770309758",  
"stdCode": "0",  
"state": "Jharkhand",  
"city": "Ranchi",  
"pinCode": "534009",  
"addressArea": "Ranchi",  
"address2": "",  
"address1": "Near Booty Mor",  
"providerName": "SURYA HOSPITAL & RESEARCH CENTRE",  
"providerNumber": 14985  
}  
},  
{  
"\_index": "hospitalsdev",  
"\_type": "hospitals",  
"\_id": "572b602929ead4c598b1b2cc",  
"\_score": 1.2816556,  
"\_source": {  
"\_id": "572b602929ead4c598b1b2cc",  
"email": "citizen\_amit1@yahoo.in",  
"emergencyNumber": "",  
"faxNumber": "2521318",  
"telephoneNumber": "6589080",  
"stdCode": "265",  
"state": "Gujarat",  
"city": "Vadodara",  
"pinCode": "390019",  
"addressArea": "",  
"address2": "Ajwa-Waghodia Ring Road",  
"address1": "Nr. Dabhoi Dashalad Bhavan",  
"providerName": "CITIZEN HOSPITAL",  
"providerNumber": 38169  
}  
}  
]  
}  
}

i am not mention complete result because no space left (5000 word limit)

---

<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:** [June 6, 2016, 1:55pm UTC](https://discuss.elastic.co/t/what-is-the-use-of-boost-in-elastic-search/51947/4 "2016-06-06T13:55:24Z")

</div>

Please format your code.

Why do you think that the first document is not more relevant than the 2nd and 3rd ones?

BTW you can use `explain` option to understand how the score is computed.

---

<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 5, 2017, 10:45pm UTC](https://discuss.elastic.co/t/what-is-the-use-of-boost-in-elastic-search/51947/5 "2017-07-05T22:45:56Z")

</div>


