# BOOSTS not always works

**URL:** <https://discuss.elastic.co/t/boosts-not-always-works/286800>\
**Category:** Elastic Search\
**Tags:** elastic-app-search\
**Created:** [October 15, 2021, 7:20am UTC](https://discuss.elastic.co/t/boosts-not-always-works/286800 "2021-10-15T07:20:11Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![PabloUrbano](https://avatars.discourse-cdn.com/v4/letter/p/b5ac83/32.png) [@PabloUrbano](https://discuss.elastic.co/u/PabloUrbano)\
**Post date:** [October 15, 2021, 7:20am UTC](https://discuss.elastic.co/t/boosts-not-always-works/286800/1 "2021-10-15T07:20:11Z")

</div>

Hello,

We are using relevance tuning to enhance various search fields. We have a text type field, made up of several arrays of charts. In this case, we can enhance or reduce the weight of the search when one of the elements of the array is "inoffer", both positively and negatively.

![Screenshot_1](https://us1.discourse-cdn.com/elastic/original/3X/0/2/02f6f0bfa6d521788aa458986b32176e4a36a2db.png)

 ![Screenshot_2](https://us1.discourse-cdn.com/elastic/original/3X/1/6/16ca8d932d6cde003d4643b60ddeaa3f4e448f91.png)

To do the test, we can lower the score of a product when it is on sale, which is perfect, it works as we expected.

We have the problem in the next field, "priority" of type number. This contains the priority of a product. The priority values ​​go from -99 to 100. What we want is that when the priority is -99, apply a negative boots to obtain less score. No matter what type of WEIGHT set, the score is never modified. We have even tried changing the priority to text. Nothing works, neither positive nor negative.  
The only way for this field to affect the score is to use a function, but what we want is to apply a specific value.  
 ![Screenshot_3](https://us1.discourse-cdn.com/elastic/original/3X/9/1/91ae66e6e780e7442aa6bad5c966addbf4bd5337.png)

 ![Screenshot_4](https://us1.discourse-cdn.com/elastic/original/3X/7/b/7bc42ad769582a52a740df226b8fe527f297f49a.png)

We have done one more test, we have a name field of type text that contains the name of the product. In this case when there is a match with the name, a positive weight causes a higher score, but a negative weight has no effect on the score. Does not matter if we enable or not the search this field

 ![Screenshot_5](https://us1.discourse-cdn.com/elastic/original/3X/3/0/301f83e09f4865f3f23aca3ae162926bc6a470cc.png)

Can someone tell us what may be happening?

Thanks for your support

---

<div class="post-metadata">

**Author:** ![Sean\_Story](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sean_story/32/69987_2.png) [@Sean\_Story](https://discuss.elastic.co/u/Sean_Story)\
**Post date:** [October 15, 2021, 4:57pm UTC](https://discuss.elastic.co/t/boosts-not-always-works/286800/2 "2021-10-15T16:57:49Z")

</div>

Hi @PabloUrbano ,

> [@PabloUrbano](#):
>
> We have the problem in the next field, "priority" of type number. This contains the priority of a product. The priority values ​​go from -99 to 100. What we want is that when the priority is -99, apply a negative boots to obtain less score

Unfortunately, "negative boosts" are not a thing. See here that the boost factor must be between 0 and 10. [Search API boosts | App Search documentation [8.11] | Elastic](https://www.elastic.co/guide/en/app-search/current/boosts.html#boosts-value-boosts)

I do see that we don't state that explicitly in the boosts guide, and we have a known issue that the UI allows you to enter in negative numbers. Sorry for the confusion, we're on it.

However, even without negative boosts, I think you could accomplish what you want. Perhaps an Exponential [Proximity boost](https://www.elastic.co/guide/en/app-search/current/boosts.html#boosts-proximity-boosts) on your `priority` field would do the trick?

> [@PabloUrbano](#):
>
> We have done one more test, we have a name field of type text that contains the name of the product. In this case when there is a match with the name, a positive weight causes a higher score, but a negative weight has no effect on the score.

Same known issue, I'm afraid. Legal weights are between 1 and 10. No negatives.

Hope this all helps!

---

<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:** [November 12, 2021, 4:58pm UTC](https://discuss.elastic.co/t/boosts-not-always-works/286800/3 "2021-11-12T16:58:24Z")

</div>

Closed on November 12, 2021, 4:58pm UTC

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