# Tweaking BM25 parameters efficiently

**URL:** https://discuss.elastic.co/t/tweaking-bm25-parameters-efficiently/15487
**Category:** Elasticsearch
**Created:** [January 30, 2014, 1:14am UTC](https://discuss.elastic.co/t/tweaking-bm25-parameters-efficiently/15487 "2014-01-30T01:14:56Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Adrien\_Ecoffet](https://avatars.discourse-cdn.com/v4/letter/a/f04885/32.png) [@Adrien\_Ecoffet](https://discuss.elastic.co/u/Adrien_Ecoffet)
#### Post date: [January 30, 2014, 1:14am UTC](https://discuss.elastic.co/t/tweaking-bm25-parameters-efficiently/15487/1 "2014-01-30T01:14:56Z")

</div>

Hi all,

I am trying to tweak the parameters of the BM25 similarity module. I am  
evaluating the quality of the results using an NDCG-like metric, and would  
like to iterate through several values of k1 and b in order to find the  
ones that maximize this score.

Unfortunately, because this is set at the index settings level, it is hard  
to iterate through these values. Because my index is very large, I would  
like to avoid having to reindex for each possible set of values (reindexing  
time can take about an hour). I tried closing the index and updating the  
settings, but it is unclear to me whether this is actually taking immediate  
effect. Of course the ideal situation would be a query-time parameter.

Is there any efficient way to iterate through many possible BM25 parameter  
values on a large index?

Thank you!

--  
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/e8c55918-e83c-4c5c-a059-5185f45d8caf%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/e8c55918-e83c-4c5c-a059-5185f45d8caf%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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, 1:54am UTC](https://discuss.elastic.co/t/tweaking-bm25-parameters-efficiently/15487/2 "2017-07-06T01:54:04Z")

</div>


