# Routing problem for mlt API

**URL:** <https://discuss.elastic.co/t/routing-problem-for-mlt-api/10079>\
**Category:** Elasticsearch\
**Created:** [December 15, 2012, 4:15pm UTC](https://discuss.elastic.co/t/routing-problem-for-mlt-api/10079 "2012-12-15T16:15:41Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![domizio](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/domizio/32/2530_2.png) [@domizio](https://discuss.elastic.co/u/domizio)\
**Post date:** [December 15, 2012, 4:15pm UTC](https://discuss.elastic.co/t/routing-problem-for-mlt-api/10079/1 "2012-12-15T16:15:41Z")

</div>

Hi all,  
I indexed some document using parent/child relationship, passing routing  
and parent when I POST the childs. Now I would like to use the mlt API but  
I am probably missing the way to pass the routing, since it doesn't find  
the document. For example:

The regular get API is working with this:

/gsa\_test/text/71450?routing=3hkTeAS5e3cpaDBk4Gsn2i

While this:

/gsa\_test/text/71450/\_mlt?routing=3hkTeAS5e3cpaDBk4Gsn2i&min\_term\_freq=1

gets {"error":"ElasticSearchException[document missing]","status":500}

What I am doing wrong?

--

---

<div class="post-metadata">

**Author:** ![mvg](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mvg/32/98890_2.png) [@mvg](https://discuss.elastic.co/u/mvg)\
**Post date:** [December 17, 2012, 9:29am UTC](https://discuss.elastic.co/t/routing-problem-for-mlt-api/10079/2 "2012-12-17T09:29:19Z")

</div>

Hi,

I think this is a bug. Looking at the code it seems that the mlt api  
doesn't take the routing into account.  
I'll look into this.

Martijn

On 15 December 2012 17:15, dd [dd.nexus@gmail.com](mailto:dd.nexus@gmail.com) wrote:

> Hi all,  
> I indexed some document using parent/child relationship, passing routing and  
> parent when I POST the childs. Now I would like to use the mlt API but I am  
> probably missing the way to pass the routing, since it doesn't find the  
> document. For example:
> 
> The regular get API is working with this:
> 
> /gsa\_test/text/71450?routing=3hkTeAS5e3cpaDBk4Gsn2i
> 
> While this:
> 
> /gsa\_test/text/71450/\_mlt?routing=3hkTeAS5e3cpaDBk4Gsn2i&min\_term\_freq=1
> 
> gets {"error":"ElasticSearchException[document missing]","status":500}
> 
> What I am doing wrong?
> 
> --

--  
Met vriendelijke groet,

Martijn van Groningen

--

---

<div class="post-metadata">

**Author:** ![mvg](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mvg/32/98890_2.png) [@mvg](https://discuss.elastic.co/u/mvg)\
**Post date:** [December 17, 2012, 9:41am UTC](https://discuss.elastic.co/t/routing-problem-for-mlt-api/10079/3 "2012-12-17T09:41:59Z")

</div>

I created the following issue for this bug:

> <https://github.com/elastic/elasticsearch/issues/2489>
>
> This simple gists demonstrates the issue: https://gist.github.com/4317085

Martijn

On 17 December 2012 10:29, Martijn v Groningen  
[martijn.v.groningen@gmail.com](mailto:martijn.v.groningen@gmail.com) wrote:

> Hi,
> 
> I think this is a bug. Looking at the code it seems that the mlt api  
> doesn't take the routing into account.  
> I'll look into this.
> 
> Martijn
> 
> On 15 December 2012 17:15, dd [dd.nexus@gmail.com](mailto:dd.nexus@gmail.com) wrote:
> 
> > Hi all,  
> > I indexed some document using parent/child relationship, passing routing and  
> > parent when I POST the childs. Now I would like to use the mlt API but I am  
> > probably missing the way to pass the routing, since it doesn't find the  
> > document. For example:
> > 
> > The regular get API is working with this:
> > 
> > /gsa\_test/text/71450?routing=3hkTeAS5e3cpaDBk4Gsn2i
> > 
> > While this:
> > 
> > /gsa\_test/text/71450/\_mlt?routing=3hkTeAS5e3cpaDBk4Gsn2i&min\_term\_freq=1
> > 
> > gets {"error":"ElasticSearchException[document missing]","status":500}
> > 
> > What I am doing wrong?
> > 
> > --
> 
> --  
> Met vriendelijke groet,
> 
> Martijn van Groningen

--  
Met vriendelijke groet,

Martijn van Groningen

--

---

<div class="post-metadata">

**Author:** ![domizio](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/domizio/32/2530_2.png) [@domizio](https://discuss.elastic.co/u/domizio)\
**Post date:** [December 17, 2012, 10:42am UTC](https://discuss.elastic.co/t/routing-problem-for-mlt-api/10079/4 "2012-12-17T10:42:08Z")

</div>

Thank you!

On Mon, Dec 17, 2012 at 10:41 AM, Martijn v Groningen \<  
[martijn.v.groningen@gmail.com](mailto:martijn.v.groningen@gmail.com)\> wrote:

> I created the following issue for this bug:  
> [Mlt api fails to work when routing isn't id based. · Issue #2489 · elastic/elasticsearch · GitHub](https://github.com/elasticsearch/elasticsearch/issues/2489)
> 
> Martijn
> 
> On 17 December 2012 10:29, Martijn v Groningen  
> [martijn.v.groningen@gmail.com](mailto:martijn.v.groningen@gmail.com) wrote:
> 
> > Hi,
> > 
> > I think this is a bug. Looking at the code it seems that the mlt api  
> > doesn't take the routing into account.  
> > I'll look into this.
> > 
> > Martijn
> > 
> > On 15 December 2012 17:15, dd [dd.nexus@gmail.com](mailto:dd.nexus@gmail.com) wrote:
> > 
> > > Hi all,  
> > > I indexed some document using parent/child relationship, passing  
> > > routing and  
> > > parent when I POST the childs. Now I would like to use the mlt API but  
> > > I am  
> > > probably missing the way to pass the routing, since it doesn't find the  
> > > document. For example:
> > > 
> > > The regular get API is working with this:
> > > 
> > > /gsa\_test/text/71450?routing=3hkTeAS5e3cpaDBk4Gsn2i
> > > 
> > > While this:
> > > 
> > > /gsa\_test/text/71450/\_mlt?routing=3hkTeAS5e3cpaDBk4Gsn2i&min\_term\_freq=1
> > > 
> > > gets {"error":"ElasticSearchException[document missing]","status":500}
> > > 
> > > What I am doing wrong?
> > > 
> > > --
> > 
> > --  
> > Met vriendelijke groet,
> > 
> > Martijn van Groningen
> 
> --  
> Met vriendelijke groet,
> 
> Martijn van Groningen
> 
> --

--

---

<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, 2:59am UTC](https://discuss.elastic.co/t/routing-problem-for-mlt-api/10079/5 "2017-07-06T02:59:40Z")

</div>


