# Choosing the similarity measure for more\_like\_this queries

**URL:** <https://discuss.elastic.co/t/choosing-the-similarity-measure-for-more-like-this-queries/28226>\
**Category:** Elasticsearch\
**Created:** [August 28, 2015, 7:07am UTC](https://discuss.elastic.co/t/choosing-the-similarity-measure-for-more-like-this-queries/28226 "2015-08-28T07:07:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![kyrre](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kyrre/32/4462_2.png) [@kyrre](https://discuss.elastic.co/u/kyrre)\
**Post date:** [August 28, 2015, 7:07am UTC](https://discuss.elastic.co/t/choosing-the-similarity-measure-for-more-like-this-queries/28226/1 "2015-08-28T07:07:36Z")

</div>

I want to specify the similarity measure used in querying for similar documents. My initially attempt was to specify this in the index's mappings section:

```
'mappings': {
            'document': {
                    'properties': {
                        'data_set_identifier': {
                            'type': 'string',
                            'index': 'not_analyzed'
                        },
                        'label': {
                            'type': 'string',
                            'index': 'not_analyzed'
                        },
                        'text': {
                            'type': 'string',
                            'index': 'analyzed',
                            'analyzer': 'english',
                            'similarity': 'BM25'
                        },
                        'y': {
                            'type': 'long',
                            'index': 'not_analyzed'
                        }
                    }
                }
        }

```

...

but this seems to have no effect (i.e., the scores are identically if I change the similarity measure).

From the Lucene [documentation](http://lucene.apache.org/core/3_0_3/api/contrib-queries/org/apache/lucene/search/similar/MoreLikeThis.html) it seems that it should be possibly to specify which similarity measure to use, but there is no mention of this feature in the ES docs.

Is it possible?

---

<div class="post-metadata">

**Author:** ![kyrre](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kyrre/32/4462_2.png) [@kyrre](https://discuss.elastic.co/u/kyrre)\
**Post date:** [August 28, 2015, 9:27am UTC](https://discuss.elastic.co/t/choosing-the-similarity-measure-for-more-like-this-queries/28226/2 "2015-08-28T09:27:54Z")

</div>

So I went through the the Lucence source and it turns out that only similarity you can use is the TFIDFSimilarity.

---

<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 5, 2017, 11:53pm UTC](https://discuss.elastic.co/t/choosing-the-similarity-measure-for-more-like-this-queries/28226/3 "2017-07-05T23:53:18Z")

</div>

Closed on July 5, 2017, 11:53pm UTC


