# Morelikethis query equivalent of deprecated morelikethis api request?

**URL:** <https://discuss.elastic.co/t/morelikethis-query-equivalent-of-deprecated-morelikethis-api-request/77130>\
**Category:** Elasticsearch\
**Created:** [March 2, 2017, 11:24am UTC](https://discuss.elastic.co/t/morelikethis-query-equivalent-of-deprecated-morelikethis-api-request/77130 "2017-03-02T11:24:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![edwineve](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/edwineve/32/48094_2.png) [@edwineve](https://discuss.elastic.co/u/edwineve)\
**Post date:** [March 2, 2017, 11:24am UTC](https://discuss.elastic.co/t/morelikethis-query-equivalent-of-deprecated-morelikethis-api-request/77130/1 "2017-03-02T11:24:33Z")

</div>

I am preparing an elasticsearch upgrade from 1.6x to 5.x. To get rid of using the deprecated morelikethis api, i am trying to use the morelikethis search query, but it gives me different results (number of documents, scoring):

Morelikethis api:

POST /collection/article/f82670e7af2bd09fb3bc2a78e09c7625/\_mlt?mlt\_fields=title,tags,intro&min\_doc\_freq=1&include=true&min\_term\_freq=1&max\_query\_terms=7&min\_word\_length=4&stop\_words='de','het','een'

{ "from" : 0, "size" : 10, "filter" : { "and" : [{ "range" : { "pubdate" : { "from" : "20170228T000000.000+0000", "to" : "20170304T000000.000+0000"}} }]} }

Morelikethis query:

POST /collection/article/\_search

{"from" : 0,"size" : 10,"query": { "more\_like\_this" : { "fields" : ["title","tags","intro"], "docs" : [{ "\_index" : "collection", "\_type" : "article", "\_id" : "f82670e7af2bd09fb3bc2a78e09c7625" }], "min\_term\_freq" : 1, "min\_word\_length" : 4, "min\_doc\_freq" : 1, "max\_query\_terms" : 7, "include" : true, "stop\_words" :["de","het","een"] }} ,"filter" : { "bool": { "must" : [{ "range" : { "pubdate" : { "from" : "20170228T000000.000+0000", "to" : "20170304T000000.000+0000"}} }]}} }

Anyone have an idea what i'm doing wrong?

---

<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:** [March 30, 2017, 11:24am UTC](https://discuss.elastic.co/t/morelikethis-query-equivalent-of-deprecated-morelikethis-api-request/77130/2 "2017-03-30T11:24:37Z")

</div>

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