# Update settings working in 2.3.4 but not in 5.1

**URL:** https://discuss.elastic.co/t/update-settings-working-in-2-3-4-but-not-in-5-1/68817
**Category:** Elasticsearch
**Created:** [December 13, 2016, 6:14am UTC](https://discuss.elastic.co/t/update-settings-working-in-2-3-4-but-not-in-5-1/68817 "2016-12-13T06:14:18Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Jimmy\_Oentung](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jimmy_oentung/32/13827_2.png) [@Jimmy\_Oentung](https://discuss.elastic.co/u/Jimmy_Oentung)
#### Post date: [December 13, 2016, 6:14am UTC](https://discuss.elastic.co/t/update-settings-working-in-2-3-4-but-not-in-5-1/68817/1 "2016-12-13T06:14:18Z")

</div>

Hi,  
I'm trying to tune BM25 b and k1 values. the following works in 2.3.4:  
{  
"settings": {  
"similarity": {  
"my\_bm25": {  
"type": "BM25",  
"b": b,  
"k1": k  
}  
}  
},  
"mappings": {  
docType: {  
"properties": {  
"title": {  
"type": "string",  
"similarity": "my\_bm25"  
},  
"body": {  
"type": "string",  
"similarity": "my\_bm25"  
}  
}  
}  
}  
}

but when I ran it on elasticsearch 5.1 (i.e.: I already change the type "string" to "text") : I got the following error:  
elasticsearch.exceptions.RequestError: TransportError(400, u'illegal\_argument\_exception', u'unknown setting [index.mappings.doc.properties.body.similarity] please check that any required plugins are installed, or check the breaking changes documentation for removed settings')

Anyone have insight on it?

---

<div class="post-metadata">

### Author: ![cbuescher](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cbuescher/32/60402_2.png) [@cbuescher](https://discuss.elastic.co/u/cbuescher)
#### Post date: [December 13, 2016, 10:16am UTC](https://discuss.elastic.co/t/update-settings-working-in-2-3-4-but-not-in-5-1/68817/2 "2016-12-13T10:16:41Z")

</div>

Hi,

I just tried this on an empty 5.1 installation, works for me. Do you see any differences to what you did, except that I set some values for b, k1?

```auto
DELETE _all

PUT /index
{
  "settings": {
    "similarity": {
      "my_bm25": {
        "type": "BM25",
        "b": 0.76,
        "k1": 1.2
      }
    }
  },
  "mappings": {
    "docType": {
      "properties": {
        "title": {
          "type": "text",
          "similarity": "my_bm25"
        },
        "body": {
          "type": "text",
          "similarity": "my_bm25"
        }
      }
    }
  }
}

```

---

<div class="post-metadata">

### Author: ![Jimmy\_Oentung](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jimmy_oentung/32/13827_2.png) [@Jimmy\_Oentung](https://discuss.elastic.co/u/Jimmy_Oentung)
#### Post date: [December 13, 2016, 11:03am UTC](https://discuss.elastic.co/t/update-settings-working-in-2-3-4-but-not-in-5-1/68817/3 "2016-12-13T11:03:34Z")

</div>

Hi Christoph,  
Thanks for the respond. Like you said, It works when i create the index. But failed when I want to update the b and k1 without reindexing.

In 2.3.4 i just need to stop, update the b & k1 values then start the index again. But this routine did not work on 5.1.

I need to do this to tune the b & k1 values. reindex is not an option as it will take forever

Thank you

---

<div class="post-metadata">

### Author: ![cbuescher](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cbuescher/32/60402_2.png) [@cbuescher](https://discuss.elastic.co/u/cbuescher)
#### Post date: [December 13, 2016, 11:19am UTC](https://discuss.elastic.co/t/update-settings-working-in-2-3-4-but-not-in-5-1/68817/4 "2016-12-13T11:19:19Z")

</div>

Hi,

after closing the index, I was able to update the custom similarity using:

```auto
PUT /index/_settings
{
    "similarity": {
      "my_bm25": {
        "type": "BM25",
        "b": 0.76,
        "k1": 1.8
      }
    }
}

```

using another k1 value. After reopeing it looks like the settings are taking effect. I'm not sure how BM25 works and whether these values affect anything for documents that have already been indexed, but I guess thats not the case. Something else must be missing on your side I guess.

---

<div class="post-metadata">

### Author: ![Jimmy\_Oentung](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jimmy_oentung/32/13827_2.png) [@Jimmy\_Oentung](https://discuss.elastic.co/u/Jimmy_Oentung)
#### Post date: [December 13, 2016, 11:01pm UTC](https://discuss.elastic.co/t/update-settings-working-in-2-3-4-but-not-in-5-1/68817/5 "2016-12-13T23:01:31Z")

</div>

Ahaaa,  
I removed the mapping section and it works like a charm.

Thank you very much Christoph

Regards,  
Jimmy

---

<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 10, 2017, 11:01pm UTC](https://discuss.elastic.co/t/update-settings-working-in-2-3-4-but-not-in-5-1/68817/6 "2017-01-10T23:01:35Z")

</div>

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