# MLT on keyword fields

**URL:** <https://discuss.elastic.co/t/mlt-on-keyword-fields/109272>\
**Category:** Elasticsearch\
**Created:** [November 27, 2017, 8:05pm UTC](https://discuss.elastic.co/t/mlt-on-keyword-fields/109272 "2017-11-27T20:05:29Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![adam3](https://avatars.discourse-cdn.com/v4/letter/a/dec6dc/32.png) [@adam3](https://discuss.elastic.co/u/adam3)\
**Post date:** [November 27, 2017, 8:05pm UTC](https://discuss.elastic.co/t/mlt-on-keyword-fields/109272/1 "2017-11-27T20:05:29Z")

</div>

Using Elasticsearch 5.3.

this query yields no results despite there being a bunch of docs with those tracks in them.  
{  
"from" : 0,  
"size" : 10,  
"query" : {  
"more\_like\_this" : {  
"fields" : ["tracks"],  
"like" : [  
{  
"doc":{  
"tracks":[  
"4niNP3ph6WyETO1j4ZgV0c",  
"4AwKXevZmsTNa3KZVj3rzl"]  
}  
} ],  
"min\_term\_freq" : 1  
}  
},  
"sort" : [ {  
"\_score" : {  
"order" : "desc"  
}  
}]  
}

The tracks field is defined as  
"tracks" : {  
"type" : "keyword",  
"doc\_values" : false  
}

We have a name field of type `text` which seems to return results in the mlt query. Do I need to change something else in the index? Is this a valid use of mlt?

Thanks and apologies as I am new to this forum.

---

<div class="post-metadata">

**Author:** ![adam3](https://avatars.discourse-cdn.com/v4/letter/a/dec6dc/32.png) [@adam3](https://discuss.elastic.co/u/adam3)\
**Post date:** [November 28, 2017, 4:27pm UTC](https://discuss.elastic.co/t/mlt-on-keyword-fields/109272/2 "2017-11-28T16:27:29Z")

</div>

Any thoughts here? Seems like mlt works on a text field but not a keyword field. Do we need doc\_values or term\_vectors to use this field in an mlt query? Any more info I can provide to get some insight here?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [December 26, 2017, 4:37pm UTC](https://discuss.elastic.co/t/mlt-on-keyword-fields/109272/3 "2017-12-26T16:37:36Z")

</div>

Closed on December 26, 2017, 4:37pm UTC

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