# Terms order and boosting impact on performance

**URL:** https://discuss.elastic.co/t/terms-order-and-boosting-impact-on-performance/3106
**Category:** Elasticsearch
**Created:** [July 15, 2010, 1:16am UTC](https://discuss.elastic.co/t/terms-order-and-boosting-impact-on-performance/3106 "2010-07-15T01:16:40Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Michael\_Korbakov](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/michael_korbakov/32/3199_2.png) [@Michael\_Korbakov](https://discuss.elastic.co/u/Michael_Korbakov)
#### Post date: [July 15, 2010, 1:16am UTC](https://discuss.elastic.co/t/terms-order-and-boosting-impact-on-performance/3106/1 "2010-07-15T01:16:40Z")

</div>

Hi everyone!

Is there any way to give documents with a set of keywords different  
relevance scores depending on keywords order?  
For instance, if I have two documents with keywords like "AAA BBB CCC"  
and "CCC DDD EEE", then I'd like to have second document to be scored  
higher then first one when searching by "CCC". This represents  
situation when most important keywords are entered first and less  
important come after them.

Another question that is more of pure curiosity: is it possible to  
harm search performance by setting 'boost' parameter in query?  
Potentially it could as it involves additional operation during score  
computation, but may be someone had a change to compare it in real use  
cases?

-- Michael Korbakov

---

<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: [August 1, 2010, 11:18am UTC](https://discuss.elastic.co/t/terms-order-and-boosting-impact-on-performance/3106/2 "2010-08-01T11:18:16Z")

</div>

This is possible, but requires writing a specialed somehow smart analyzer  
and probably query for it. I can't think of another simple way to do it  
(now)... . I do something along those lines for the all fields, where  
boosted fields retain their boosted information when aggregated into the all  
field.

-shay.banon

On Thu, Jul 15, 2010 at 4:16 AM, Mykhailo Korbakov [rmihael@gmail.com](mailto:rmihael@gmail.com)wrote:

> Hi everyone!
> 
> Is there any way to give documents with a set of keywords different  
> relevance scores depending on keywords order?  
> For instance, if I have two documents with keywords like "AAA BBB CCC"  
> and "CCC DDD EEE", then I'd like to have second document to be scored  
> higher then first one when searching by "CCC". This represents  
> situation when most important keywords are entered first and less  
> important come after them.
> 
> Another question that is more of pure curiosity: is it possible to  
> harm search performance by setting 'boost' parameter in query?  
> Potentially it could as it involves additional operation during score  
> computation, but may be someone had a change to compare it in real use  
> cases?
> 
> -- Michael Korbakov

---

<div class="post-metadata">

### Author: ![Michael\_Korbakov](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/michael_korbakov/32/3199_2.png) [@Michael\_Korbakov](https://discuss.elastic.co/u/Michael_Korbakov)
#### Post date: [August 10, 2010, 10:23pm UTC](https://discuss.elastic.co/t/terms-order-and-boosting-impact-on-performance/3106/3 "2010-08-10T22:23:54Z")

</div>

I've managed to workaround this problems by adding special unique  
token to the beginning of my keywords list and then doing phrase  
search with very large slop (tried 1000). So my keyword list now look  
in this way: "keywords": ["LONGUNIQUETOKENATLISTSTART", "AAA", "BBB",  
"CCC", "DDD"]. After making sloped search with "query":  
""LONGUNIQUETOKENATLISTSTART CCC"" I'm getting results with scores  
depending on CCC position versus list start.

On Aug 1, 2:18 pm, Shay Banon [shay.ba...@elasticsearch.com](mailto:shay.ba...@elasticsearch.com) wrote:

> This is possible, but requires writing a specialed somehow smart analyzer  
> and probably query for it. I can't think of another simple way to do it  
> (now)... . I do something along those lines for the all fields, where  
> boosted fields retain their boosted information when aggregated into the all  
> field.
> 
> -shay.banon
> 
> On Thu, Jul 15, 2010 at 4:16 AM, Mykhailo Korbakov [rmih...@gmail.com](mailto:rmih...@gmail.com)wrote:
> 
> > Hi everyone!
> 
> > Is there any way to give documents with a set of keywords different  
> > relevance scores depending on keywords order?  
> > For instance, if I have two documents with keywords like "AAA BBB CCC"  
> > and "CCC DDD EEE", then I'd like to have second document to be scored  
> > higher then first one when searching by "CCC". This represents  
> > situation when most important keywords are entered first and less  
> > important come after them.
> 
> > Another question that is more of pure curiosity: is it possible to  
> > harm search performance by setting 'boost' parameter in query?  
> > Potentially it could as it involves additional operation during score  
> > computation, but may be someone had a change to compare it in real use  
> > cases?
> 
> > -- Michael Korbakov

---

<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, 4:20am UTC](https://discuss.elastic.co/t/terms-order-and-boosting-impact-on-performance/3106/4 "2017-07-06T04:20:58Z")

</div>


