# How to reduce the high score when a term appears repeatedly in a record in Elasticsearch, for example, the term 'fruit' should have a lower score in the record 'fruit' compared to 'record2 fruit xx fruit'?

**URL:** <https://discuss.elastic.co/t/how-to-reduce-the-high-score-when-a-term-appears-repeatedly-in-a-record-in-elasticsearch-for-example-the-term-fruit-should-have-a-lower-score-in-the-record-fruit-compared-to-record2-fruit-xx-fruit/368879>\
**Category:** Elasticsearch\
**Created:** [October 16, 2024, 2:04am UTC](https://discuss.elastic.co/t/how-to-reduce-the-high-score-when-a-term-appears-repeatedly-in-a-record-in-elasticsearch-for-example-the-term-fruit-should-have-a-lower-score-in-the-record-fruit-compared-to-record2-fruit-xx-fruit/368879 "2024-10-16T02:04:43Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![lmr520](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lmr520/32/138390_2.png) [@lmr520](https://discuss.elastic.co/u/lmr520)\
**Post date:** [October 16, 2024, 2:04am UTC](https://discuss.elastic.co/t/how-to-reduce-the-high-score-when-a-term-appears-repeatedly-in-a-record-in-elasticsearch-for-example-the-term-fruit-should-have-a-lower-score-in-the-record-fruit-compared-to-record2-fruit-xx-fruit/368879/1 "2024-10-16T02:04:43Z")

</div>

How to reduce the high score when a term appears repeatedly in a record in Elasticsearch, for example, the term 'fruit' should have a lower score in the record 'fruit' compared to 'record2 fruit xx fruit'?

---

<div class="post-metadata">

**Author:** ![Carlos\_D](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/carlos_d/32/126245_2.png) [@Carlos\_D](https://discuss.elastic.co/u/Carlos_D)\
**Post date:** [October 16, 2024, 6:06am UTC](https://discuss.elastic.co/t/how-to-reduce-the-high-score-when-a-term-appears-repeatedly-in-a-record-in-elasticsearch-for-example-the-term-fruit-should-have-a-lower-score-in-the-record-fruit-compared-to-record2-fruit-xx-fruit/368879/2 "2024-10-16T06:06:10Z")

</div>

Hi @lmr520 :

You can implement a custom similarity for calculating score using the [similarity module](https://www.elastic.co/guide/en/elasticsearch/reference/current/index-modules-similarity.html). This provides a way of tweaking BM25 default similarity, and using other similarities including defining your own via scripting.

Also, custom scoring can be achieved using the [script score query](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-script-score-query.html).

Defining a custom similarity is no small feat. What problem are you trying to solve by decreasing the score for more frequent terms?
