More like this

Hello.

I’m using mlt query like

curl -XGET '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?

You can try something like this:

curl -XGET '
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

Hello.

I’m using mlt query like

curl -XGET '
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?

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

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?

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

Shay, please correct that typo here: Elasticsearch Platform — Find real-time answers at scale | Elastic

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' -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
Hello.

I’m using mlt query like

curl -XGET '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?

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

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

Shay, please correct that typo here:
Elasticsearch Platform — Find real-time answers at scale | Elastic

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'
-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
Hello.

I’m using mlt query like

curl -XGET '
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?