MLT doesn't seem to work. Please help!


(Jozsef Szalay) #1

I'm using the latest 1.7.1 release of Elastic with Oracle JDK 8.0_40 on Linux. The following sequence of statements don't produce what I'm expecting. What am I doing wrong? Please help, thanks.

The index

curl -XPUT http://localhost:9200/mlt_test/_mappings/mlt_type -d ‘{"mlt_type":{"properties":{"text":{"type":"string","analyzer":"keyword","term_vector":"yes"}}}}'

Added two documents

curl -XPUT http://localhost:9200/mlt_test/mlt_type/1 -d '{"text":["1113064548","1229341624","1322900872","2721480379","3160379314","3855009424","4137621045","4241342909"]}'

curl -XPUT http://localhost:9200/mlt_test/mlt_type/2 -d '{"text":["2566818807","2721480379","3502753730","4021564766"]}'

MLT returns doc 2 even though only 1 term matches.

curl -XGET 'http://localhost:9200/mlt_test/mlt_type/_search?pretty' -d '{"fields":["id", "text"],"query":{"more_like_this":{"ids":["1"],"min_term_freq":0, "min_doc_freq":0, "minimum_should_match":"30%"}}}'

I expected no results. Variations on the min/max input parameters didn't help either.


(Andrei Stefan) #2

Take a look at this github issue description for mlt.


(Jozsef Szalay) #3

Thanks for the github link. Guess, I have to generate my own boolean query using the term vectors in order to gain more control over how the parameters are used.


(system) #4