# More Like This issues and default settings

**URL:** <https://discuss.elastic.co/t/more-like-this-issues-and-default-settings/17649>\
**Category:** Elasticsearch\
**Created:** [May 21, 2014, 5:32pm UTC](https://discuss.elastic.co/t/more-like-this-issues-and-default-settings/17649 "2014-05-21T17:32:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![redrubia](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/redrubia/32/1554_2.png) [@redrubia](https://discuss.elastic.co/u/redrubia)\
**Post date:** [May 21, 2014, 5:32pm UTC](https://discuss.elastic.co/t/more-like-this-issues-and-default-settings/17649/1 "2014-05-21T17:32:56Z")

</div>

I have added two documents, all being the same but with different id's. The  
main aim of this being to test out a More Like This query

Now the document is as follows:

curl -XPUT '[http://localhost:9200/blog/post/1](http://localhost:9200/blog/post/1)' -d '  
{  
"user": "dilbert",  
"postDate": "2011-12-15",  
"body": "Search is hard. Search should be easy." ,  
"title": "On search"  
}'

This is then added again changing the doc id to 2. I query this as follows:

curl -XGET '[http://localhost:9200/blog/post/2/\_mlt?mlt\_fields=body&min\_doc\_freq=1](http://localhost:9200/blog/post/2/_mlt?mlt_fields=body&min_doc_freq=1)'

> > {"took":2,"timed\_out":false,"\_shards":{"total":5,"successful":5,"failed":0},"hits":{"total":1,"max\_score":0.16273327,"hits":[{"\_index":"blog","\_type":"post","\_id":"1","\_score":0.16273327, "\_source" :  
> > {  
> > "user": "dilbert",  
> > "postDate": "2011-12-15",  
> > "body": "Search is hard. Search should be easy." ,  
> > "title": "On search"  
> > }}]}}%

But now I want to query on another aspect, like title, I get no results:

curl -XGET '[http://localhost:9200/blog/post/2/\_mlt?mlt\_fields=title&min\_doc\_freq=1](http://localhost:9200/blog/post/2/_mlt?mlt_fields=title&min_doc_freq=1)'

> > {"took":1,"timed\_out":false,"\_shards":{"total":5,"successful":5,"failed":0},"hits":{"total":0,"max\_score":null,"hits":}}%

Does this mean body defaults to being the only thing you can use More Like  
This on?

I assumed it was due to no mapping being set by myself, and tried the  
queries again just querying the title, before body - assuming my query had  
an impact on setting the 'like this' property. But again querying with body  
returned results, title and user did not return any results, although  
identical.

I think thought maybe it was due to 'body', alphabetically being before  
'user' and 'title' and thus the default maybe looks at the property higher  
in the alphabet. So I deleted the index,curl -XDELETE localhost:9200/blog and  
retried, with a new document input

curl -XPUT '[http://localhost:9200/blog/post/1](http://localhost:9200/blog/post/1)' -d '  
{  
"abc": "lala land",  
"user": "dilbert",  
"postDate": "2011-12-15",  
"body": "Search is hard. Search should be easy." ,  
"title": "On search"  
}'

But once again the MLT only seems to work on body. Seems odd!

Any ideas as to where I am going wrong? I even restarted my ES to try and  
get it working.

EDIT: I've now tried setting my own mapping before adding docs:

curl -XPOST '[http://localhost:9200/blog/post/\_mapping](http://localhost:9200/blog/post/_mapping)' -d '{  
"post" : {  
"properties" : {  
"body" : {  
"type" : "string",  
"store" : true  
},  
"postDate" : {  
"type" : "date",  
"format" : "dateOptionalTime",  
"store" : true  
},  
"title" : {  
"type" : "string",  
"store" : true  
},  
"user" : {  
"type" : "string",  
"store" : true  
}  
}  
}  
}'

This adds that every property is stored,as specified as a requirement in MLT[http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-more-like-this.html#search-more-like-this](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-more-like-this.html#search-more-like-this) but  
alas, still nothing is returned when querying other properties.

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/f16c1fa5-bfa7-4c73-ae12-20cce0b6e578%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/f16c1fa5-bfa7-4c73-ae12-20cce0b6e578%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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, 1:27am UTC](https://discuss.elastic.co/t/more-like-this-issues-and-default-settings/17649/2 "2017-07-06T01:27:49Z")

</div>

Closed on July 6, 2017, 1:27am UTC


