I would probably add a num_of_children field in parent doc and update it when a 
new child is added or removed.

But I guess it depends on your actual use case!

--
David ;-)
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 7 janv. 2014 à 08:15, Alexander Stautner <alexander.staut...@gmail.com> a 
écrit :

> Sorry for bumping, but i need an answer, if it's posible to answer the 
> question above with elasticsearch
> 
> Am Donnerstag, 2. Januar 2014 15:22:32 UTC+1 schrieb Alexander Stautner:
>> 
>> Hello,
>> after some research without any results I have a question about parent/child 
>> relations.
>> 
>> The case:
>> 
>> I have a parent of type "parent_type" which has children of different types 
>> e.g. "child_type_1", "child_type_2", "child_type_3".
>> 
>> My Question is:
>> 
>> Is there any possibility to get only the parents which have at least x 
>> children of type "child_type_2"  with an specific value in an attribute.
>> 
>> e.g
>> 
>> parent_type: family
>> child_type_1: girl attribute:name
>> child_type_2: boy attribute:name
>> child_type_3: cat attribute:name
>> 
>> And i want to have all families which have at least three girls with name 
>> "Jane".
>> 
>> 
>> Thank you for your help,
>> Alex 
> 
> -- 
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/elasticsearch/6622897e-3e72-4db4-b4a0-4d8555c077e8%40googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/85E9435C-F658-45A3-9F84-C9CE0EA697DB%40pilato.fr.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to