Exact match possible when using More Like This Query (MLT)?

I'm using ElasticSearch 5.4.3 I'm trying to put together a "more like this" type search query, but wondering is there a way to do an exact match? Here is my code which works, but it treats the "like" value as individual words and I'd like to treat the "like" value as an exact value similar to how match phrase works. Is this possible?

In the below code I'd like the like value to be treated as "Java Developer" not "java" or "developer" which is what it appears to be doing based on the results I'm getting back.

GET /myindex/mytype/_search
{
    "query": {
        "more_like_this" : {
            "fields" : ["job_title"],
            "like" : "Java Developer",
            "min_term_freq" : 1,
            "max_query_terms" : 12
        }
    }
}

if you want an exact match, why not executing a regular match or term query against job_title.keyword? No need for MLT..

1 Like

Yes, that's fair enough. I guess I got caught up in the term "More like this" and assumed I needed that functionality. Thanks for helping me not over engineer.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.