# MLT returns zero results

**URL:** <https://discuss.elastic.co/t/mlt-returns-zero-results/14475>\
**Category:** Elasticsearch\
**Created:** [November 19, 2013, 9:17pm UTC](https://discuss.elastic.co/t/mlt-returns-zero-results/14475 "2013-11-19T21:17:03Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Christoph\_Haas](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christoph_haas/32/1947_2.png) [@Christoph\_Haas](https://discuss.elastic.co/u/Christoph_Haas)\
**Post date:** [November 19, 2013, 9:17pm UTC](https://discuss.elastic.co/t/mlt-returns-zero-results/14475/1 "2013-11-19T21:17:03Z")

</div>

I'm struggling with using MLT ("more-like-that") API queries. In my case  
the simple documents contain two fields.

Example:

{  
\_index: "debshots",  
\_type: "jdbc",  
\_id: "396",  
\_version: 35,  
exists: true,  
\_source: {  
description: "Alarm Clock for GTK Environments",  
name: "alarm-clock"  
}  
}

But when I'm GETting [http://localhost:9200/debshots/jdbc/396/\_mlt](http://localhost:9200/debshots/jdbc/396/_mlt)  
Elasticsearch returns zero results:

{  
took: 3,  
timed\_out: false,  
\_shards: {  
total: 1,  
successful: 1,  
failed: 0  
},  
hits: {  
total: 0,  
max\_score: null,  
hits: []  
}  
}

There are many other documents with a description like "Alarm curl  
plugin for uWSGI" so I had expected that at least the "Alarm" is a term  
that makes it "more-like-that"-style.

I'd welcome a hint what is going wrong here. Thanks.

Kindly  
…Christoph

--  
A distributed system is one in which I cannot get something done  
because a machine I've never heard of is down. (Leslie Lamport)

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Randall\_McRee](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/randall_mcree/32/47177_2.png) [@Randall\_McRee](https://discuss.elastic.co/u/Randall_McRee)\
**Post date:** [November 20, 2013, 1:51am UTC](https://discuss.elastic.co/t/mlt-returns-zero-results/14475/2 "2013-11-20T01:51:23Z")

</div>

Check out:

> **[Elasticsearch Platform — Find real-time answers at scale](https://www.elastic.co)**
>
> Power insights and outcomes with the Elasticsearch Platform and AI. See into your data and find answers that matter with enterprise solutions designed to help you build, observe, and protect. Try Elasticsearch free today.

Note that the default values are designed for a large corpus, not a test  
example. In particular, you are butting your head against one or more of  
(and this is a guess, but I do have a working implementation of MLT):

percent\_terms\_to\_match  
min\_term\_freq  
min\_doc\_freq

pretty sure you need to set these, not let them default.

On Tue, Nov 19, 2013 at 1:17 PM, Christoph Haas [email@christoph-haas.de](mailto:email@christoph-haas.de)wrote:

> I'm struggling with using MLT ("more-like-that") API queries. In my case  
> the simple documents contain two fields.
> 
> Example:
> 
> {  
> \_index: "debshots",  
> \_type: "jdbc",  
> \_id: "396",  
> \_version: 35,  
> exists: true,  
> \_source: {  
> description: "Alarm Clock for GTK Environments",  
> name: "alarm-clock"  
> }  
> }
> 
> But when I'm GETting [http://localhost:9200/debshots/jdbc/396/\_mlt](http://localhost:9200/debshots/jdbc/396/_mlt)  
> Elasticsearch returns zero results:
> 
> {  
> took: 3,  
> timed\_out: false,  
> \_shards: {  
> total: 1,  
> successful: 1,  
> failed: 0  
> },  
> hits: {  
> total: 0,  
> max\_score: null,  
> hits:   
> }  
> }
> 
> There are many other documents with a description like "Alarm curl  
> plugin for uWSGI" so I had expected that at least the "Alarm" is a term  
> that makes it "more-like-that"-style.
> 
> I'd welcome a hint what is going wrong here. Thanks.
> 
> Kindly  
> …Christoph
> 
> --  
> A distributed system is one in which I cannot get something done  
> because a machine I've never heard of is down. (Leslie Lamport)
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Christoph\_Haas](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christoph_haas/32/1947_2.png) [@Christoph\_Haas](https://discuss.elastic.co/u/Christoph_Haas)\
**Post date:** [November 20, 2013, 1:14pm UTC](https://discuss.elastic.co/t/mlt-returns-zero-results/14475/3 "2013-11-20T13:14:57Z")

</div>

Am 20.11.2013 02:51, schrieb Randall McRee:

> Check out:  
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-mlt-query.html)
> 
> Note that the default values are designed for a large corpus, not a  
> test example. In particular, you are butting your head against one or  
> more of (and this is a guess, but I do have a working implementation  
> of MLT):
> 
> percent\_terms\_to\_match  
> min\_term\_freq  
> min\_doc\_freq
> 
> pretty sure you need to set these, not let them default.  
> Thank you - that was it. I set min\_term\_freq=1 and received goot  
> results. My fields are rather short (like "Alarm Clock for GTK  
> Environments"). So I understand that the default is term\_freq=1 which  
> means that the term "Alarm" would have to occur at least twice before it  
> would make another document "related".

…Christoph

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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 6, 2017, 2:05am UTC](https://discuss.elastic.co/t/mlt-returns-zero-results/14475/4 "2017-07-06T02:05:56Z")

</div>


