Elasticsearch allows you to configure a scoring algorithm or similarity per field. The <code>similarity</code>setting provides a simple way of choosing a similarity algorithm other than the default <code>BM25</code>, such as <code>TF/IDF</code>.
The only similarities which can be used out of the box, without any further configuration are:
<dl></dl>
<dt><code>BM25</code></dt>
<dt><code>classic</code></dt>
<dt><code>boolean</code></dt>
<dd>A simple boolean similarity, which is used when full-text ranking is not needed and the score should only be based on whether the query terms match or not. Boolean similarity gives terms a score equal to their query boost.</dd>
The <code>similarity</code> can be set on the field level when a field is first created, as follows:
<a href="https://www.elastic.co/guide/en/elasticsearch/reference/5.4/similarity.html#CO232-1"></a>
The <code>default_field</code> uses the <code>BM25</code> similarity.
<a href="https://www.elastic.co/guide/en/elasticsearch/reference/5.4/similarity.html#CO232-2"></a>
The <code>classic_field</code> uses the <code>classic</code> similarity (ie TF/IDF).
<a href="https://www.elastic.co/guide/en/elasticsearch/reference/5.4/similarity.html#CO232-3"></a>
The <code>boolean_sim_field</code> uses the <code>boolean</code> similarity.
By default, Elasticsearch will use whatever similarity is configured as <code>default</code>. However, the similarity functions <code>queryNorm()</code> and <code>coord()</code> are not per-field. Consequently, for expert users wanting to change the implementation used for these two methods, while not changing the <code>default</code>, it is possible to configure a similarity with the name <code>base</code>. This similarity will then be used for the two methods.