# More like this

**URL:** <https://discuss.elastic.co/t/more-like-this/4943>\
**Category:** Elasticsearch\
**Created:** [July 25, 2011, 11:45am UTC](https://discuss.elastic.co/t/more-like-this/4943 "2011-07-25T11:45:07Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![yark](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/yark/32/3148_2.png) [@yark](https://discuss.elastic.co/u/yark)\
**Post date:** [July 25, 2011, 11:45am UTC](https://discuss.elastic.co/t/more-like-this/4943/1 "2011-07-25T11:45:07Z")

</div>

Hello.

I’m using mlt query like

curl -XGET '[http://localhost:9200/tt/uu/id/\_mlt?fields=content1,content2&min\_doc\_freq=1’](http://localhost:9200/tt/uu/id/_mlt?fields=content1,content2&min_doc_freq=1%E2%80%99)

to match docs only by two content fields.

can I restict returned fields to some "informative\_field1» instead returning all doc?

---

<div class="post-metadata">

**Author:** ![Igor\_Motov](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/igor_motov/32/45193_2.png) [@Igor\_Motov](https://discuss.elastic.co/u/Igor_Motov)\
**Post date:** [July 25, 2011, 7:25pm UTC](https://discuss.elastic.co/t/more-like-this/4943/2 "2011-07-25T19:25:16Z")

</div>

You can try something like this:

curl -XGET '  
[http://localhost:9200/tt/uu/id/\_mlt?mlt\_fields=content1,content2&min\_doc\_freq=1](http://localhost:9200/tt/uu/id/_mlt?mlt_fields=content1,content2&min_doc_freq=1)'  
-d '{"fields" : ["informative\_field1", "informative\_field2"]}'

BTW, I think there is a typo on the web site, so you should use "mlt\_fields"  
instead of "fields" if you want to use only a subset of fields to generate  
MLT search.

Igor

2011/7/25 Yaroslav [th-net@ya.ru](mailto:th-net@ya.ru)

> Hello.
> 
> I’m using mlt query like
> 
> curl -XGET '  
> [http://localhost:9200/tt/uu/id/\_mlt?fields=content1,content2&min\_doc\_freq=1](http://localhost:9200/tt/uu/id/_mlt?fields=content1,content2&min_doc_freq=1)  
> ’
> 
> to match docs only by two content fields.
> 
> can I restict returned fields to some "informative\_field1» instead  
> returning all doc?

---

<div class="post-metadata">

**Author:** ![Vladimir\_Shkurin](https://avatars.discourse-cdn.com/v4/letter/v/94ad74/32.png) [@Vladimir\_Shkurin](https://discuss.elastic.co/u/Vladimir_Shkurin)\
**Post date:** [July 25, 2011, 10:34pm UTC](https://discuss.elastic.co/t/more-like-this/4943/3 "2011-07-25T22:34:58Z")

</div>

Hi! I use ElasticSearch with MongoDB and I need to find documents like  
to another document.

OK, I created an index for a couple of hundreds of articles, but after  
searching:

[http://localhost:9200/articles/article/4df007a5f10a8527e400002e/\_mlt?min\_doc\_freq=1](http://localhost:9200/articles/article/4df007a5f10a8527e400002e/_mlt?min_doc_freq=1)

I got it:

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

The standard search works fine, but MLT search found no documents.  
What's the problem?

---

<div class="post-metadata">

**Author:** ![yark](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/yark/32/3148_2.png) [@yark](https://discuss.elastic.co/u/yark)\
**Post date:** [July 26, 2011, 7:11am UTC](https://discuss.elastic.co/t/more-like-this/4943/4 "2011-07-26T07:11:17Z")

</div>

Many thanks.  
It’s totally what i want to do 🙂

Shay, please correct that typo here: [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/api/more-like-this.html)

25 лип. 2011, в 22:25, Igor Motov написал(а):

> You can try something like this:
> 
> curl -XGET '[http://localhost:9200/tt/uu/id/\_mlt?mlt\_fields=content1,content2&min\_doc\_freq=1](http://localhost:9200/tt/uu/id/_mlt?mlt_fields=content1,content2&min_doc_freq=1)' -d '{"fields" : ["informative\_field1", "informative\_field2"]}'
> 
> BTW, I think there is a typo on the web site, so you should use "mlt\_fields" instead of "fields" if you want to use only a subset of fields to generate MLT search.
> 
> Igor
> 
> 2011/7/25 Yaroslav [th-net@ya.ru](mailto:th-net@ya.ru)  
> Hello.
> 
> > I’m using mlt query like
> > 
> > curl -XGET '[http://localhost:9200/tt/uu/id/\_mlt?fields=content1,content2&min\_doc\_freq=1’](http://localhost:9200/tt/uu/id/_mlt?fields=content1,content2&min_doc_freq=1%E2%80%99)
> > 
> > to match docs only by two content fields.
> > 
> > can I restict returned fields to some "informative\_field1» instead returning all doc?

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [July 26, 2011, 7:17am UTC](https://discuss.elastic.co/t/more-like-this/4943/5 "2011-07-26T07:17:26Z")

</div>

Fixed. Just a note on mlt API, basically, what it does is GET and then  
constructs a search request that includes an mlt query, if some of the  
parameters / the way that it works is not exactly one wants, you can always  
do it on the client side...

2011/7/26 Yaroslav [th-net@ya.ru](mailto:th-net@ya.ru)

> Many thanks.  
> It’s totally what i want to do 🙂
> 
> Shay, please correct that typo here:  
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/api/more-like-this.html)
> 
> 25 лип. 2011, в 22:25, Igor Motov написал(а):
> 
> > You can try something like this:
> > 
> > curl -XGET '  
> > [http://localhost:9200/tt/uu/id/\_mlt?mlt\_fields=content1,content2&min\_doc\_freq=1](http://localhost:9200/tt/uu/id/_mlt?mlt_fields=content1,content2&min_doc_freq=1)'  
> > -d '{"fields" : ["informative\_field1", "informative\_field2"]}'
> > 
> > BTW, I think there is a typo on the web site, so you should use  
> > "mlt\_fields" instead of "fields" if you want to use only a subset of fields  
> > to generate MLT search.
> > 
> > Igor
> > 
> > 2011/7/25 Yaroslav [th-net@ya.ru](mailto:th-net@ya.ru)  
> > Hello.
> > 
> > > I’m using mlt query like
> > > 
> > > curl -XGET '  
> > > [http://localhost:9200/tt/uu/id/\_mlt?fields=content1,content2&min\_doc\_freq=1](http://localhost:9200/tt/uu/id/_mlt?fields=content1,content2&min_doc_freq=1)  
> > > ’
> > > 
> > > to match docs only by two content fields.
> > > 
> > > can I restict returned fields to some "informative\_field1» instead  
> > > returning all doc?

---

<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:59am UTC](https://discuss.elastic.co/t/more-like-this/4943/6 "2017-07-06T03:59:25Z")

</div>


