# Error "illegal\_argument\_exception" illegal b value: 1.2 BM25

**URL:** <https://discuss.elastic.co/t/error-illegal-argument-exception-illegal-b-value-1-2-bm25/198437>\
**Category:** Elasticsearch\
**Created:** [September 6, 2019, 2:26pm UTC](https://discuss.elastic.co/t/error-illegal-argument-exception-illegal-b-value-1-2-bm25/198437 "2019-09-06T14:26:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dpappas](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dpappas/32/52571_2.png) [@dpappas](https://discuss.elastic.co/u/dpappas)\
**Post date:** [September 6, 2019, 2:26pm UTC](https://discuss.elastic.co/t/error-illegal-argument-exception-illegal-b-value-1-2-bm25/198437/1 "2019-09-06T14:26:12Z")

</div>

Hello everyone

I tried hyper parameter tuning BM25 and unfortunately i tried putting b=1.2 in the settings which was wrong wince it always gets a value between zero and one.

Now i try to fix the value of b but i get the following error:

curl -XPUT "[http://localhost:9200/my\_index/\_settings](http://localhost:9200/my_index/_settings)" -d '  
{  
"similarity": {  
"my\_similarity": {  
"type": "BM25",  
"b" : 0.1,  
"k1" : 0.9  
}  
}  
}'

{"error":{"root\_cause":[{"type":"illegal\_argument\_exception","reason":"illegal b value: 1.2, must be between 0 and 1"}],"type":"illegal\_argument\_exception","reason":"illegal b value: 1.2, must be between 0 and 1"},"status":400}

It seems like it sticks to the former wrong value of "1.2" and does not understand that the new value o want to set is 0.1

Could you help me?  
Thank you in advance

---

<div class="post-metadata">

**Author:** ![rjernst](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rjernst/32/6363_2.png) [@rjernst](https://discuss.elastic.co/u/rjernst)\
**Post date:** [September 13, 2019, 6:20pm UTC](https://discuss.elastic.co/t/error-illegal-argument-exception-illegal-b-value-1-2-bm25/198437/2 "2019-09-13T18:20:14Z")

</div>

Could you please look at your log file and grab the entire exception stack trace?

---

<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:** [October 11, 2019, 6:20pm UTC](https://discuss.elastic.co/t/error-illegal-argument-exception-illegal-b-value-1-2-bm25/198437/3 "2019-10-11T18:20:18Z")

</div>

Closed on October 11, 2019, 6:20pm UTC

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