# Changing default similarity of an index

**URL:** https://discuss.elastic.co/t/changing-default-similarity-of-an-index/231193
**Category:** Elasticsearch
**Created:** [May 5, 2020, 4:27pm UTC](https://discuss.elastic.co/t/changing-default-similarity-of-an-index/231193 "2020-05-05T16:27:43Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![mich123prem](https://avatars.discourse-cdn.com/v4/letter/m/cc9497/32.png) [@mich123prem](https://discuss.elastic.co/u/mich123prem)
#### Post date: [May 5, 2020, 4:27pm UTC](https://discuss.elastic.co/t/changing-default-similarity-of-an-index/231193/1 "2020-05-05T16:27:43Z")

</div>

### Hello!

#### I am using elasticsearch in a university course on IR, and it is therefore interesting to change the default similarity of an index to show differences in performance related to the different similarities.

In version _6.5_, changing similarity was easy (just close the index, set new default similarity, open and refresh.

In Version _7.5_, this features behaves strangely. It seems that upon change in similarity, elasticsearch does not clear the old similarity arguments. If I have **DFR** as current default similarity, and want to substitute it by **BM25** , ES will protest and say that _"basic\_model"_ is a wrong parameter for **BM25**. The workaround I found by googling is to explicitly set all the arguments of the old similarity function to **null** , and send them along with the **put\_settings** API call when setting the new similarity.

Is this a bug, or a feature to facilitate something?

Is there a better way to achieve this change of default similarity?

Thanks

Michael

---

<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: [June 2, 2020, 4:27pm UTC](https://discuss.elastic.co/t/changing-default-similarity-of-an-index/231193/2 "2020-06-02T16:27:52Z")

</div>

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