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


(byuva) #1

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.
To view this discussion on the web visit 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.


(Binh Ly-2) #2

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.
To view this discussion on the web visit 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.


(byuva) #3

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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/30c2463b-ea7e-430a-b43c-d5461727c763%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


(system) #4