# MLT API returns zero result when specifying mlt\_fields, return results when not using mlt\_fields

**URL:** <https://discuss.elastic.co/t/mlt-api-returns-zero-result-when-specifying-mlt-fields-return-results-when-not-using-mlt-fields/23676>\
**Category:** Elasticsearch\
**Created:** [May 23, 2015, 10:25am UTC](https://discuss.elastic.co/t/mlt-api-returns-zero-result-when-specifying-mlt-fields-return-results-when-not-using-mlt-fields/23676 "2015-05-23T10:25:04Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Iwan\_Budi\_Kusnanto](https://avatars.discourse-cdn.com/v4/letter/i/a5b964/32.png) [@Iwan\_Budi\_Kusnanto](https://discuss.elastic.co/u/Iwan_Budi_Kusnanto)\
**Post date:** [May 23, 2015, 10:25am UTC](https://discuss.elastic.co/t/mlt-api-returns-zero-result-when-specifying-mlt-fields-return-results-when-not-using-mlt-fields/23676/1 "2015-05-23T10:25:04Z")

</div>

Hi All,

I was trying to use MLT API and confused with it's behavior when i  
specify mlt\_fields in URL query.

Here are my tests: (URL used is not the real URL)

1. curl -XGET '[http://localhost:9200/twitter/tweet/1/\_mlt?min\_doc\_freq=1](http://localhost:9200/twitter/tweet/1/_mlt?min_doc_freq=1)'  
It returned array of result, as expected

2. curl -XGET '[http://localhost:9200/twitter/tweet/1/\_mlt?mlt\_fields=bd,tag,content&min\_doc\_freq=1](http://localhost:9200/twitter/tweet/1/_mlt?mlt_fields=bd,tag,content&min_doc_freq=1)'

It returns zero result.  
i am sure it was wrong because there are many documents which have  
same 'bd' fields.  
{"took":5,"timed\_out":false,"\_shards":{"total":5,"successful":5,"failed":0},"hits":{"total":0,"max\_score":null,"hits":[]}}

1. curl -XGET '[http://localhost:9200/twitter/tweet/1/\_mlt?fields=bd,tag,content&min\_doc\_freq=1](http://localhost:9200/twitter/tweet/1/_mlt?fields=bd,tag,content&min_doc_freq=1)'

In this step, i changed 'mlt\_fields' to 'fields'.  
It returns array of result, different than (1)

My questions :

- whats wrong with (2)? I am sure the URL query is right, because this  
is the URL mentioned in docs.
- why (3) different thant(1)?

Thanks

--  
Iwan Budi Kusnanto

## -- Please update your bookmarks! We have moved to [https://discuss.elastic.co/](https://discuss.elastic.co/)

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](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAG%2BDCt%2B8YoihDgOhHYwk0XPAMLYOvyqXnva%2B%2BukfM7sR59e6rg%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAG%2BDCt%2B8YoihDgOhHYwk0XPAMLYOvyqXnva%2B%2BukfM7sR59e6rg%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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:** [July 6, 2017, 12:12am UTC](https://discuss.elastic.co/t/mlt-api-returns-zero-result-when-specifying-mlt-fields-return-results-when-not-using-mlt-fields/23676/2 "2017-07-06T00:12:15Z")

</div>


