# More Like This Query - Not Working?

**URL:** <https://discuss.elastic.co/t/more-like-this-query-not-working/32610>\
**Category:** Elasticsearch\
**Created:** [October 20, 2015, 6:17pm UTC](https://discuss.elastic.co/t/more-like-this-query-not-working/32610 "2015-10-20T18:17:08Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Garrett\_Johnson](https://avatars.discourse-cdn.com/v4/letter/g/41988e/32.png) [@Garrett\_Johnson](https://discuss.elastic.co/u/Garrett_Johnson)\
**Post date:** [October 20, 2015, 6:17pm UTC](https://discuss.elastic.co/t/more-like-this-query-not-working/32610/1 "2015-10-20T18:17:08Z")

</div>

I'm using an mlt query to query for other documents that are like a document in a type.

When I query however I'm not getting results I would expect.

Below is looking for documents of a similar to "MyType" document ID #LONGIDSTRINGABC123 but when I run the search sometimes it comes back with multiple types and sometimes it does not. In this case it is finding lots of MyType documents but none of other types.

I think what is happening is I am limiting to 250 results and all 250 are in "MyType" but I want it to only find 25 in "MyType" and get as many as 25 from any other type that may be similar. Am I doing something wrong with my aggs? I've also fiddled around with min\_term\_frequency and max\_query\_terms and no tweaking helps.

Example of my query:

{  
"query": {  
"more\_like\_this": {  
"fields": [  
"Email",  
"Name",  
"LastName",  
"Phone",  
"Identifier",  
"PostalCode",  
"AccountName",  
"Street",  
"Website",  
"City",  
"Company",  
"Notes"  
],  
"docs": [  
{  
"\_index": "jdbc",  
"\_type": "MyType",  
"\_id": "LONGIDSTRINGABC123"  
}  
],  
"min\_term\_freq": 1,  
"max\_query\_terms": 60,  
"stop\_words": [  
"Install",  
"Site",  
"Site",  
"Purchased"  
]  
}  
},  
"from": 0,  
"size": 250,  
"aggs": {  
"top\_types": {  
"terms": {  
"field": "\_type"  
},  
"aggs": {  
"top\_type\_hits": {  
"top\_hits": {  
"size": 25  
}  
}  
}  
}  
}  
}

---

<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:43pm UTC](https://discuss.elastic.co/t/more-like-this-query-not-working/32610/2 "2017-07-05T23:43:47Z")

</div>


