# How to Deboost the final Score of the results when it matches set of Term/Range Filters

**URL:** <https://discuss.elastic.co/t/how-to-deboost-the-final-score-of-the-results-when-it-matches-set-of-term-range-filters/321490>\
**Category:** Elasticsearch\
**Created:** [December 18, 2022, 11:38am UTC](https://discuss.elastic.co/t/how-to-deboost-the-final-score-of-the-results-when-it-matches-set-of-term-range-filters/321490 "2022-12-18T11:38:07Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lakshman\_Raj\_Vasudev](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lakshman_raj_vasudev/32/114862_2.png) [@Lakshman\_Raj\_Vasudev](https://discuss.elastic.co/u/Lakshman_Raj_Vasudev)\
**Post date:** [December 18, 2022, 11:38am UTC](https://discuss.elastic.co/t/how-to-deboost-the-final-score-of-the-results-when-it-matches-set-of-term-range-filters/321490/1 "2022-12-18T11:38:07Z")

</div>

Hi,  
We have an Scenario,When the query matches certain Set of Term/Range Filter,Deboost the Relevancy Score of those matching documents with a boost Factor,as the usage of negative boosts were not permitted in the Latest Versions.  
Also we tried to give the boost factor between 0 to 1,and that only subtracts to the same amount(for example,0.25) from the existing score,which doesn't creates much impact.  
In our case,positive boosting works well,as well give higher boost factor to create an impact in the resultant set.

**Example** ,  
"should":  
{{#toJson}}boost\_criteria{{/toJson}},  
"minimum\_should\_match":0

In this boost\_criteria,we will be passing set of term filters encapsulating in an bool,as when it matches,it will boost the document.In the above document,minimum\_should\_match is made as 0,as the documents should not be used as filters.If one of the condition matches with the filters,it will boost the relevancy score of the matching docs.  
But we cant able to use the same script,for bury.  
Kindly help us to solve this problem for **deboosting documents which are matching set of Term/Range Filters,with an deboosted boost Factor**.

---

<div class="post-metadata">

**Author:** ![RabBit\_BR](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rabbit_br/32/82261_2.png) [@RabBit\_BR](https://discuss.elastic.co/u/RabBit_BR)\
**Post date:** [December 18, 2022, 1:18pm UTC](https://discuss.elastic.co/t/how-to-deboost-the-final-score-of-the-results-when-it-matches-set-of-term-range-filters/321490/2 "2022-12-18T13:18:08Z")

</div>

Hi @Lakshman_Raj_Vasudev

You tried to use [Boosting query](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-boosting-query.html)?

---

<div class="post-metadata">

**Author:** ![Lakshman\_Raj\_Vasudev](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lakshman_raj_vasudev/32/114862_2.png) [@Lakshman\_Raj\_Vasudev](https://discuss.elastic.co/u/Lakshman_Raj_Vasudev)\
**Post date:** [December 20, 2022, 7:42pm UTC](https://discuss.elastic.co/t/how-to-deboost-the-final-score-of-the-results-when-it-matches-set-of-term-range-filters/321490/3 "2022-12-20T19:42:21Z")

</div>

Hi @RabBit_BR ,  
But the Negative Boosting Query,Doesn't supports multiple negative boost factors based on the provided term/range filters.  
For example,

```auto
[
                  {
                    "bool" : {
                      "must" : [
                        {
                          "terms" : {
                            "brand" : [
                              "bob"
                            ],
                            "boost" : 100.0
                          }
                        }
                      ]
                    }
                  },
                  {
                    "bool" : {
                      "must" : [
                        {
                          "terms" : {
                            "title" : [
                              "alice"
                            ],
                            "boost" : 66.0
                          }
                        }
                      ]
                    }
                  }
                ]

```

In the Above like snippet,based on the filter condition,we need a scenario to differentiate the negative boost factor as well(Like "boost" parameter mentioned above)

---

<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:** [January 17, 2023, 7:42pm UTC](https://discuss.elastic.co/t/how-to-deboost-the-final-score-of-the-results-when-it-matches-set-of-term-range-filters/321490/4 "2023-01-17T19:42:46Z")

</div>

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