# \_mlt will only take "routing" parameter but not "parent"

**URL:** <https://discuss.elastic.co/t/-mlt-will-only-take-routing-parameter-but-not-parent/16179>\
**Category:** Elasticsearch\
**Created:** [March 5, 2014, 9:47pm UTC](https://discuss.elastic.co/t/-mlt-will-only-take-routing-parameter-but-not-parent/16179 "2014-03-05T21:47:24Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![byuva](https://avatars.discourse-cdn.com/v4/letter/b/b5ac83/32.png) [@byuva](https://discuss.elastic.co/u/byuva)\
**Post date:** [March 5, 2014, 9:47pm UTC](https://discuss.elastic.co/t/-mlt-will-only-take-routing-parameter-but-not-parent/16179/1 "2014-03-05T21:47:24Z")

</div>

I had though that "parent" and "routing" were interchangeable and parent  
was preferred when identifying child documents. However I've noticed that  
the \_mlt endpoint only seems to accept routing.

/test\_index/test\_type/text/mydoc?routing=mydoc

# Expected document

/test\_index/test\_type/text/mydoc?parent=mydoc

# Expected document

/test\_index/test\_type/text/mydoc/\_mlt?routing=mydoc

# Expected results

/test\_index/test\_type/text/mydoc/\_mlt?parent=mydoc

# {"error":"RoutingMissingException[routing is required for

[test\_index]/[test\_type]/[mydoc]]","status":400}

Is this distinction intentional? I am using 1.0.1

-brian

--  
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/44b646a4-a2f0-4363-9bbe-34c91697157a%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/44b646a4-a2f0-4363-9bbe-34c91697157a%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Binh\_Ly\_2](https://avatars.discourse-cdn.com/v4/letter/b/d07c76/32.png) [@Binh\_Ly\_2](https://discuss.elastic.co/u/Binh_Ly_2)\
**Post date:** [March 6, 2014, 9:37pm UTC](https://discuss.elastic.co/t/-mlt-will-only-take-routing-parameter-but-not-parent/16179/2 "2014-03-06T21:37:55Z")

</div>

They are are actually two different things. parent is to identify parents  
for parent-child relationships. routing is to tell ES to shortcut the  
search/indexing only to a specific shard.

It's interesting that the second call works (it must have been implemented  
for convenience) but in general if you're indexing or searching, I'd use  
routing. If you are indexing a child document, then use parent to point to  
its parent document.

--  
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/a4a8ffa3-25f1-4cb2-8166-23c46e41be04%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/a4a8ffa3-25f1-4cb2-8166-23c46e41be04%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![byuva](https://avatars.discourse-cdn.com/v4/letter/b/b5ac83/32.png) [@byuva](https://discuss.elastic.co/u/byuva)\
**Post date:** [March 8, 2014, 1:24am UTC](https://discuss.elastic.co/t/-mlt-will-only-take-routing-parameter-but-not-parent/16179/3 "2014-03-08T01:24:13Z")

</div>

Thanks for the reply. I still am not sure I understand the distinction  
between routing and parent. This document is part of a parent-\>child  
relationship and at index time I specify "parent" not "routing". It seems  
odd that at retrieval time (and only for the mlt API) routing is required.

On Thursday, March 6, 2014 4:37:55 PM UTC-5, Binh Ly wrote:

> They are are actually two different things. parent is to identify parents  
> for parent-child relationships. routing is to tell ES to shortcut the  
> search/indexing only to a specific shard.
> 
> It's interesting that the second call works (it must have been implemented  
> for convenience) but in general if you're indexing or searching, I'd use  
> routing. If you are indexing a child document, then use parent to point to  
> its parent document.

--  
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/30c2463b-ea7e-430a-b43c-d5461727c763%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/30c2463b-ea7e-430a-b43c-d5461727c763%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, 1:44am UTC](https://discuss.elastic.co/t/-mlt-will-only-take-routing-parameter-but-not-parent/16179/4 "2017-07-06T01:44:43Z")

</div>


