# More\_like\_this query returns no results unless min\_doc\_freq increased

**URL:** <https://discuss.elastic.co/t/more-like-this-query-returns-no-results-unless-min-doc-freq-increased/163824>\
**Category:** Elasticsearch\
**Created:** [January 11, 2019, 1:00am UTC](https://discuss.elastic.co/t/more-like-this-query-returns-no-results-unless-min-doc-freq-increased/163824 "2019-01-11T01:00:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![pgodzin](https://avatars.discourse-cdn.com/v4/letter/p/ecd19e/32.png) [@pgodzin](https://discuss.elastic.co/u/pgodzin)\
**Post date:** [January 11, 2019, 1:00am UTC](https://discuss.elastic.co/t/more-like-this-query-returns-no-results-unless-min-doc-freq-increased/163824/1 "2019-01-11T01:00:50Z")

</div>

I am posting the following query against the \_explain endpoint of a document with "three" in the title field

```
{
"query": {
    "bool": {
        "must": [
            {
                "bool": {
                    "should": [
                        {
                            "more_like_this": {
                                "min_doc_freq": 1,
                                "fields": [
                                    "title"
                                ],
                                "max_query_terms": 10,
                                "like": "Three Reasons Spice Girls Will Reunite (And Three Why They Won't)",
                                "min_term_freq": 1
                            }
                        },
                        {
                            "more_like_this": {
                                "min_doc_freq": 1,
                                "fields": [
                                    "description"
                                ],
                                "max_query_terms": 10,
                                "like": "Three Reasons Spice Girls Will Reunite (And Three Why They Won't)",
                                "min_term_freq": 1
                            }
                        }
                    ]
                }
            }
        ]
    }
}

```

}

The response/explanation I get:

```
"matched": false,
"explanation": {
    "value": 0,
    "description": "Failure to meet condition(s) of required/prohibited clause(s)",
    "details": [
        {
            "value": 0,
            "description": "no match on required clause (((title:girl title:and title:why title:will title:thei title:won title:reason title:reunit title:spice title:three)~3) ((description:and description:why description:thei description:won description:girl description:will description:reason description:spice description:reunit description:three)~3))",
            "details": [
                {
                    "value": 0,
                    "description": "No matching clauses",
                    "details": []
                }
            ]
        },
        {
            "value": 0,
            "description": "match on required clause, product of:",
            "details": [
                {
                    "value": 0,
                    "description": "# clause",
                    "details": []
                },
                {
                    "value": 0.023566995,
                    "description": "_type:media, product of:",
                    "details": [
                        {
                            "value": 1,
                            "description": "boost",
                            "details": []
                        },
                        {
                            "value": 0.023566995,
                            "description": "queryNorm",
                            "details": []
                        }
                    ]
                }
            ]
        }
    ]
}

```

However, if I increase either min\_term\_freq from 1 to 2, I get a match. Similarly, I get a match if I remove several terms from the like query, for example "Three Reasons Spice (And Three)".

Why does this make sense that it would match as the criteria gets more strict (min\_term\_freq increases) or the number of terms that can match decreases?

---

<div class="post-metadata">

**Author:** ![Mark\_Harwood](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mark_harwood/32/10538_2.png) [@Mark\_Harwood](https://discuss.elastic.co/u/Mark_Harwood)\
**Post date:** [January 11, 2019, 4:17pm UTC](https://discuss.elastic.co/t/more-like-this-query-returns-no-results-unless-min-doc-freq-increased/163824/2 "2019-01-11T16:17:28Z")

</div>

Part of MLT you're not setting is the bit that controls [how many of the selected terms have to match.](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-mlt-query.html#_query_formation_parameters)

The default is 30%. Maybe that's why as you increase the `min_term_freq` your selection of top 10 terms focuses more on boring words that are repeated a lot which means you stand a better chance of getting 30% of them to match.

---

<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:** [February 8, 2019, 4:17pm UTC](https://discuss.elastic.co/t/more-like-this-query-returns-no-results-unless-min-doc-freq-increased/163824/3 "2019-02-08T16:17:30Z")

</div>

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