# More Like This Query Returning 0 Similar Documents

**URL:** <https://discuss.elastic.co/t/more-like-this-query-returning-0-similar-documents/20997>\
**Category:** Elasticsearch\
**Created:** [December 1, 2014, 7:29am UTC](https://discuss.elastic.co/t/more-like-this-query-returning-0-similar-documents/20997 "2014-12-01T07:29:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sekharreddy\_mandapat](https://avatars.discourse-cdn.com/v4/letter/s/c4cdca/32.png) [@sekharreddy\_mandapat](https://discuss.elastic.co/u/sekharreddy_mandapat)\
**Post date:** [December 1, 2014, 7:29am UTC](https://discuss.elastic.co/t/more-like-this-query-returning-0-similar-documents/20997/1 "2014-12-01T07:29:19Z")

</div>

I have more than 500 documents. While executing more\_like\_this query  
elasticsearch returning zero results.  
Below is my query.

POST /espoc/\_search  
{  
"from": 0,  
"size": 2,  
"query": {  
"filtered": {  
"query": {  
"more\_like\_this": {  
"fields": [  
"subject",  
"body",  
"contentbase64"  
],  
"docs": [  
{  
"\_index": "espoc",  
"\_type": "mail",  
"\_id": "07e028bf-02c7-48d8-980f-f870dee70c4f"  
}  
]  
}  
},  
"filter": {  
"or": [  
{  
"term": {  
"userId": "8a40b965-c061-4fa9-aba0-4228c3b12f28"  
}  
}  
]  
}  
}  
},  
"fields": "isWorkspace"  
}

--  
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/ed862018-e281-4894-839a-b781f582a7d3%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/ed862018-e281-4894-839a-b781f582a7d3%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![sekharreddy\_mandapat](https://avatars.discourse-cdn.com/v4/letter/s/c4cdca/32.png) [@sekharreddy\_mandapat](https://discuss.elastic.co/u/sekharreddy_mandapat)\
**Post date:** [December 19, 2014, 6:30am UTC](https://discuss.elastic.co/t/more-like-this-query-returning-0-similar-documents/20997/2 "2014-12-19T06:30:09Z")

</div>

Issue is solved by adding \*\_routing \*value in every \*docs \*object. If we  
using routing while indexing documents we have to use the \*\_routing \*value  
in every \*docs \*object instead of specifying it in url [POST /espoc/\_search?  
\*\_routing=\*\*\*\*\*].

On Monday, 1 December 2014 12:59:20 UTC+5:30, sekharreddy mandapati wrote:

> I have more than 500 documents. While executing more\_like\_this query  
> elasticsearch returning zero results.  
> Below is my query.
> 
> POST /espoc/\_search  
> {  
> "from": 0,  
> "size": 2,  
> "query": {  
> "filtered": {  
> "query": {  
> "more\_like\_this": {  
> "fields": [  
> "subject",  
> "body",  
> "contentbase64"  
> ],  
> "docs": [  
> {  
> "\_index": "espoc",  
> "\_type": "mail",  
> "\_id": "07e028bf-02c7-48d8-980f-f870dee70c4f"  
> }  
> ]  
> }  
> },  
> "filter": {  
> "or": [  
> {  
> "term": {  
> "userId": "8a40b965-c061-4fa9-aba0-4228c3b12f28"  
> }  
> }  
> ]  
> }  
> }  
> },  
> "fields": "isWorkspace"  
> }

--  
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/ce094dfd-e408-42ef-bf05-3eb07eae87fb%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/ce094dfd-e408-42ef-bf05-3eb07eae87fb%40googlegroups.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:42am UTC](https://discuss.elastic.co/t/more-like-this-query-returning-0-similar-documents/20997/3 "2017-07-06T00:42:46Z")

</div>

Closed on July 6, 2017, 12:42am UTC


