Has_parent query and routing

Hi there,

I read in the docs:
When indexing a child document, the routing value is automatically set to
be the same as it’s parent, unless the routing value is explicitly
specified using the routing parameter.
I was wondering about this routing, the fact that elasticsearch chooses the
same routing value as it's parent must mean this will improve performance
query time (why else would it choose the routing value for you).

What would change in the performance characteristics for a has_parent (or
has_child) query if you would change the default and have it so that the
parents route to let's say shard 0 and childs (of which there are far more)
to shard 1-7?

Jaap

--

Hello!

ElasticSearch parent child functionality needs to have parent and its children in the same shard, so you just can't place children in other shards.

--

Regards,

Rafał Kuć

Sematext :: http://sematext.com/ :: Solr - Lucene - Nutch - ElasticSearch

Hi there,

I read in the docs:

When indexing a child document, the routing value is automatically set to be the same as it’s parent, unless the routing value is explicitly specified using the routing parameter.

I was wondering about this routing, the fact that elasticsearch chooses the same routing value as it's parent must mean this will improve performance query time (why else would it choose the routing value for you).

What would change in the performance characteristics for a has_parent (or has_child) query if you would change the default and have it so that the parents route to let's say shard 0 and childs (of which there are far more) to shard 1-7?

Jaap

--

If there was an impl that allowed child docs and parent docs to be on
different shards the performance would be very slow. (Imagine what sort of
information would needed to be send over the wire to all nodes to check
what child belongs what parent doc.)

On top of the fact that parent and its child docs reside on the same shard,
there is also on id_cache available to efficiently join the child and
parent docs to make the joining snappy.

Martijn

On 18 January 2013 16:28, Rafał Kuć r.kuc@solr.pl wrote:

Hello!

ElasticSearch parent child functionality needs to have parent and its
children in the same shard, so you just can't place children in other
shards.

*--
Regards,
Rafał Kuć
Sematext :: http://sematext.com/ :: Solr - Lucene - Nutch -
ElasticSearch

Hi there,

I read in the docs:
When indexing a child document, the routing value is automatically set to
be the same as it’s parent, unless the routing value is explicitly
specified using the routing parameter.
I was wondering about this routing, the fact that elasticsearch chooses
the same routing value as it's parent must mean this will improve
performance query time (why else would it choose the routing value for you).

What would change in the performance characteristics for a has_parent (or
has_child) query if you would change the default and have it so that the
parents route to let's say shard 0 and childs (of which there are far more)
to shard 1-7?

Jaap

--

--
Met vriendelijke groet,

Martijn van Groningen

--

That's a clear answer, thanks Rafal and Martijn!

Jaap

--