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'?

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'?

Hi @lmr520 :

You can implement a custom similarity for calculating score using the similarity module. 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.

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