# Question about boost and scoring

**URL:** <https://discuss.elastic.co/t/question-about-boost-and-scoring/7497>\
**Category:** Elasticsearch\
**Created:** [April 27, 2012, 4:57pm UTC](https://discuss.elastic.co/t/question-about-boost-and-scoring/7497 "2012-04-27T16:57:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Evgeniy\_Galkin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/evgeniy_galkin/32/2741_2.png) [@Evgeniy\_Galkin](https://discuss.elastic.co/u/Evgeniy_Galkin)\
**Post date:** [April 27, 2012, 4:57pm UTC](https://discuss.elastic.co/t/question-about-boost-and-scoring/7497/1 "2012-04-27T16:57:56Z")

</div>

Hello.  
I have the next problem.  
I have n types of objects with some text fields in each.  
I want to give some priorities to these fields. So in search results i  
should see at first only matches from the most prior field, then from  
the next and so on.

Example:  
Let's imagine we have 2 types: type\_a and type\_b. We have fields  
type\_a.f1, type\_a.f2 and type\_b.f1.  
So I want to see in my search results at first only matches from  
type\_a.f1, next from type\_a.f2 and at last from the type\_b.f1.

I've experimented with boost and discovered the next things.

1. Usualy \_score value for the document without boosting is between  
0.1 and 10.
2. As far as I understand, \_score of boosted document is boost \*  
\_score.
3. If I'm right in my 2 previous statements, the boost value for more  
prior document should be at least 100 times more than for less prior  
one to guarantee priority sorting. It means that I should have boost =  
1 for type\_b.f1 (and its score should be between 0.1 and 10), boost =  
100 for type\_a.f2 (and score between 10 and 1000) and boost = 10000  
for type\_a.f1 (score between 1000 and 100000).  
But if I have 4 types with 4 fields in each, boost value for the most  
prior field should be 10^15.

Is it normal or there is another way to order matches by the priority  
of the type and field? What is the numeric range of boost value?

P.S. Yes, I can make 4 or 16 queries instead of one (one query per  
field), but it's not convenient for me because I show all results as a  
single page with pagination (using "size" and "from" API parameters)

P.S. 2. Sorry for my bad English, I hope that you understand me.

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [April 29, 2012, 4:58pm UTC](https://discuss.elastic.co/t/question-about-boost-and-scoring/7497/2 "2012-04-29T16:58:19Z")

</div>

Do you set boosting while indexing? Its a bit problematic since it  
looses precision, maybe you can boost while querying?

On Fri, Apr 27, 2012 at 7:57 PM, Evgeniy Galkin [evgeniy@parkflyer.ru](mailto:evgeniy@parkflyer.ru)wrote:

> Hello.  
> I have the next problem.  
> I have n types of objects with some text fields in each.  
> I want to give some priorities to these fields. So in search results i  
> should see at first only matches from the most prior field, then from  
> the next and so on.
> 
> Example:  
> Let's imagine we have 2 types: type\_a and type\_b. We have fields  
> type\_a.f1, type\_a.f2 and type\_b.f1.  
> So I want to see in my search results at first only matches from  
> type\_a.f1, next from type\_a.f2 and at last from the type\_b.f1.
> 
> I've experimented with boost and discovered the next things.
> 
> 1. Usualy \_score value for the document without boosting is between  
> 0.1 and 10.
> 2. As far as I understand, \_score of boosted document is boost \*  
> \_score.
> 3. If I'm right in my 2 previous statements, the boost value for more  
> prior document should be at least 100 times more than for less prior  
> one to guarantee priority sorting. It means that I should have boost =  
> 1 for type\_b.f1 (and its score should be between 0.1 and 10), boost =  
> 100 for type\_a.f2 (and score between 10 and 1000) and boost = 10000  
> for type\_a.f1 (score between 1000 and 100000).  
> But if I have 4 types with 4 fields in each, boost value for the most  
> prior field should be 10^15.
> 
> Is it normal or there is another way to order matches by the priority  
> of the type and field? What is the numeric range of boost value?
> 
> P.S. Yes, I can make 4 or 16 queries instead of one (one query per  
> field), but it's not convenient for me because I show all results as a  
> single page with pagination (using "size" and "from" API parameters)
> 
> P.S. 2. Sorry for my bad English, I hope that you understand me.

---

<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, 3:30am UTC](https://discuss.elastic.co/t/question-about-boost-and-scoring/7497/3 "2017-07-06T03:30:39Z")

</div>


