More like this

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

More like this

yark
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?

smime.p7s (5K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: More like this

Igor Motov-3
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 <[hidden email]>
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?

Reply | Threaded
Open this post in threaded view
|

Re: More like this

Vladimir Shkurin
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?
Reply | Threaded
Open this post in threaded view
|

Re: More like this

yark
In reply to this post by Igor Motov-3
Many thanks.
It’s totally what i want to do :)

Shay, please correct that typo here: 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' -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 <[hidden email]>
> 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?


smime.p7s (5K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: More like this

kimchy
Administrator
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 <[hidden email]>
Many thanks.
It’s totally what i want to do :)

Shay, please correct that typo here: 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' -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 <[hidden email]>
> 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?