BM25 similarities in Elasticsearch

I want to change the default Elasticsearch affinity to BM25.

According to

http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.4/index-modules-similarity.html

I need to add the following line to elasticsearch.yml file

index.similarity.default.type: BM25

However, BM25 has two input parameters k1

and b

which I would like to set as well.

Does anyone know how to set these parameters?

+3


source to share


2 answers


in your index settings, set the similarity parameters as you would display



PUT /your_index/?pretty=1
{
       "settings": {
          "similarity": {
             "bm25-inverse-zero": {
                "type": "BM25",
                "b": 0
             }
          },
}

      

+1


source


I found a really good page that explains the meaning of the parameters. It's located here: https://www.elastic.co/guide/en/elasticsearch/guide/current/pluggable-similarites.html

Here is a snippet from that page:



k1: This parameter determines how quickly the increase in the period frequency leads to saturation in frequency. The default is 1.2. Lower values ​​result in faster saturation and higher values ​​at slower saturation.

b: This parameter determines how much field length normalization should be performed. A value of 0.0 completely disables normalization, and a value of 1.0 normalizes completely. The default is 0.75.

+1


source







All Articles