Elastic Search MLT API, how to use fields with weights


(Pir Abdul Rasool Qureshi) #1

Hi,

I want to use ElasticSearch MLT API, to find a set of documents similar to
a document in my index. Since, I do not have "like_text" and do not want to
make an extra request for retrieving "like text", I am using MLT API with
document Id. The problem is that in our schema some fields weight more
than other. For example, keywords_1 has double weight than keywords_2. Let
us say I want to calculate "more like this" on these two fields, How can I
do that?

I have already tried using mlt_fields=keywords_1^2,keywords_2 but it is not
working as it is expected. On empirical testing it appears that it is
treating both fields as equal.

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/665ae7cd-48b6-4776-b75c-d5cbb87e11ed%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


(Binh Ly) #2

I do not believe you can boost individual fields/terms separately in a MLT
query. Your best bet is to probably run a bool query of multiple MLT
queries each with a different field and boost, but you'll need to first
extract the MLT text before you can do this.

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/d3450173-b0af-4b8e-900c-54c68f2c382a%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


(Alex Ksikes) #3

I'd like to add to this that mlt API is the same as a boolean query DSL
made of multiple more like this field clauses, where each field is set to
the content of the field of the queried document.

On Thursday, February 20, 2014 4:20:36 PM UTC+1, Binh Ly wrote:

I do not believe you can boost individual fields/terms separately in a MLT
query. Your best bet is to probably run a bool query of multiple MLT
queries each with a different field and boost, but you'll need to first
extract the MLT text before you can do this.

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/2fcd0453-58dc-4a66-b7d9-2e785a2a7fa6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


(system) #4