# Update similarity measure for existing index

**URL:** https://discuss.elastic.co/t/update-similarity-measure-for-existing-index/20163
**Category:** Elasticsearch
**Created:** [October 9, 2014, 1:58pm UTC](https://discuss.elastic.co/t/update-similarity-measure-for-existing-index/20163 "2014-10-09T13:58:47Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![CC1](https://avatars.discourse-cdn.com/v4/letter/c/9fc348/32.png) [@CC1](https://discuss.elastic.co/u/CC1)
#### Post date: [October 9, 2014, 1:58pm UTC](https://discuss.elastic.co/t/update-similarity-measure-for-existing-index/20163/1 "2014-10-09T13:58:47Z")

</div>

I have an existing index for which the default ElasticSearch similarity is  
used for all fields. I would like to update this index and set some other  
type of similarity, like BM25. The query I tried is:

curl -XPOST '[http://localhost:9200/myindex/](http://localhost:9200/myindex/)' -d '{"settings":{"similarity":{"newSimilarity":{"type":"BM25"}}}}'

However, this crashes with an IndexAlreadyExists exception. Still, is it  
possible to update the similarity measure for all fields inside this index  
without having to reindex the data?

Thanks!

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/d6463b4f-129b-41de-8fbc-bbc446887b54%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/d6463b4f-129b-41de-8fbc-bbc446887b54%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![Ivan](https://avatars.discourse-cdn.com/v4/letter/i/df788c/32.png) [@Ivan](https://discuss.elastic.co/u/Ivan)
#### Post date: [October 9, 2014, 5:44pm UTC](https://discuss.elastic.co/t/update-similarity-measure-for-existing-index/20163/2 "2014-10-09T17:44:38Z")

</div>

You cannot change the similarity on an existing index. There is no  
technical measure why it could not occur, it appears to be simply a method  
in place to prevent users from creating potentially huge errors. I say that  
developers should have the option to shoot themselves in the foot!

Cheers,

Ivan

On Thu, Oct 9, 2014 at 6:58 AM, CC [cr1st1na.garbacea@gmail.com](mailto:cr1st1na.garbacea@gmail.com) wrote:

> I have an existing index for which the default Elasticsearch similarity is  
> used for all fields. I would like to update this index and set some other  
> type of similarity, like BM25. The query I tried is:
> 
> curl -XPOST '[http://localhost:9200/myindex/](http://localhost:9200/myindex/)' -d '{"settings":{"similarity":{"newSimilarity":{"type":"BM25"}}}}'
> 
> However, this crashes with an IndexAlreadyExists exception. Still, is it  
> possible to update the similarity measure for all fields inside this index  
> without having to reindex the data?
> 
> Thanks!
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/d6463b4f-129b-41de-8fbc-bbc446887b54%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/d6463b4f-129b-41de-8fbc-bbc446887b54%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/d6463b4f-129b-41de-8fbc-bbc446887b54%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/d6463b4f-129b-41de-8fbc-bbc446887b54%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CALY%3DcQA1zQg%3DVwz2JwRnzeAFqEs0-d5Eg-egM6qBoFc4OV\_JZQ%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CALY%3DcQA1zQg%3DVwz2JwRnzeAFqEs0-d5Eg-egM6qBoFc4OV_JZQ%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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: [July 6, 2017, 12:57am UTC](https://discuss.elastic.co/t/update-similarity-measure-for-existing-index/20163/3 "2017-07-06T00:57:14Z")

</div>


