# More like this only work with min\_term\_freq = 1

**URL:** <https://discuss.elastic.co/t/more-like-this-only-work-with-min-term-freq-1/5426>\
**Category:** Elasticsearch\
**Created:** [September 21, 2011, 3:16pm UTC](https://discuss.elastic.co/t/more-like-this-only-work-with-min-term-freq-1/5426 "2011-09-21T15:16:44Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Post](https://avatars.discourse-cdn.com/v4/letter/p/ea666f/32.png) [@Post](https://discuss.elastic.co/u/Post)\
**Post date:** [September 21, 2011, 3:16pm UTC](https://discuss.elastic.co/t/more-like-this-only-work-with-min-term-freq-1/5426/1 "2011-09-21T15:16:44Z")

</div>

Hi,

i'm a new user but elastic search is amazing! I use it for a PHP  
project and use the elastica php client.

I created an index and insert 30.000 documents. With mysql i search  
title like 'foo bar boo' and he finds 5 entrys. If i try eleastic  
search with the more like this function i doesn't find any entry. Only  
if if i set min\_term\_freq to 1.

I thing it musst be an error on analyzing the text?

The Code:  
$queryMlt = new Elastica\_Query\_MoreLikeThis();  
$queryMlt-\>setFields(array('humanTitle'));  
$queryMlt-\>setLikeText(strtolower($filter['mltTitle']));  
$queryMlt-\>setMinTermFrequency(2);  
$queryMlt-\>setAnalyzer('whitespace');  
$queryBool-\>addMust($queryMlt);  
Doesn't find any thing.

The Mapping is like this:  
$mapping = array(  
'title' =\> array('type' =\> 'string', 'store' =\>  
'yes','index'=\>'analyzed','analyzer'=\>'simple'),  
'humanTitle' =\> array('type' =\> 'string', 'store' =\>  
'yes','index'=\>'analyzed'),  
'categoryId' =\> array('type' =\> 'integer', 'store' =\>  
'yes'),  
'showDate' =\> array('type' =\> 'string', 'store' =\>  
'no'),  
'genre' =\> array('type' =\> 'string', 'store' =\>  
'no','index'=\>'analyzed'),  
'image' =\> array('type' =\> 'string', 'store' =\>  
'yes','index'=\>'no'),  
'status' =\> array('type' =\> 'string', 'store' =\>  
'no','index'=\>'analyzed'),  
);

Where is the fault?

---

<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, 3:53am UTC](https://discuss.elastic.co/t/more-like-this-only-work-with-min-term-freq-1/5426/2 "2017-07-06T03:53:55Z")

</div>


