# 1.0.0 Beta2 - GET children for Parent/Child does not seem to work

**URL:** <https://discuss.elastic.co/t/1-0-0-beta2-get-children-for-parent-child-does-not-seem-to-work/15186>\
**Category:** Elasticsearch\
**Created:** [January 10, 2014, 12:09am UTC](https://discuss.elastic.co/t/1-0-0-beta2-get-children-for-parent-child-does-not-seem-to-work/15186 "2014-01-10T00:09:14Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![george\_monroe](https://avatars.discourse-cdn.com/v4/letter/g/bbce88/32.png) [@george\_monroe](https://discuss.elastic.co/u/george_monroe)\
**Post date:** [January 10, 2014, 12:09am UTC](https://discuss.elastic.co/t/1-0-0-beta2-get-children-for-parent-child-does-not-seem-to-work/15186/1 "2014-01-10T00:09:14Z")

</div>

Hi,

I'm doing a simple test with 1.0.0 Beta 2. I've indexed a parent record  
and three children. The head plugin shows all the children, and the search  
endpoint returns all three children with different id's. But, for some  
strange reason, I can only GET by id one of the children. Does someone  
have a clue, or could this be a bug?

curl -XGET localhost:9200/d3/transactions/\_search?pretty  
{  
"took" : 2,  
"timed\_out" : false,  
"\_shards" : {  
"total" : 5,  
"successful" : 5,  
"failed" : 0  
},  
"hits" : {  
"total" : 3,  
"max\_score" : 1.0,  
"hits" : [ {  
"\_index" : "d3",  
"\_type" : "transactions",  
"\_id" : "3",  
"\_score" : 1.0, "\_source" : { "date" : "2012-12-01", "description" :  
"Nail polish", "amount" : 80.00}  
}, {  
"\_index" : "d3",  
"\_type" : "transactions",  
"\_id" : "2",  
"\_score" : 1.0, "\_source" : { "date" : "2012-10-14", "description" :  
"Nail polish", "amount" : 70.00}  
}, {  
"\_index" : "d3",  
"\_type" : "transactions",  
"\_id" : "1",  
"\_score" : 1.0, "\_source" : { "date" : "2013-01-01", "description" :  
"Nail polish", "amount" : 75.50}  
} ]  
}  
}

curl -XGET localhost:9200/d3/transactions/1?pretty  
{  
"\_index" : "d3",  
"\_type" : "transactions",  
"\_id" : "1",  
"\_version" : 2,  
"exists" : true, "\_source" : { "date" : "2013-01-01", "description" :  
"Nail polish", "amount" : 75.50}  
}

curl -XGET localhost:9200/d3/transactions/2?pretty  
{  
"\_index" : "d3",  
"\_type" : "transactions",  
"\_id" : "2",  
"exists" : false  
}

curl -XGET localhost:9200/d3/transactions/3?pretty  
{  
"\_index" : "d3",  
"\_type" : "transactions",  
"\_id" : "3",  
"exists" : false  
}

--  
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/41376241-31ab-488a-bac8-19618cbc60be%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/41376241-31ab-488a-bac8-19618cbc60be%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:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [January 10, 2014, 3:55am UTC](https://discuss.elastic.co/t/1-0-0-beta2-get-children-for-parent-child-does-not-seem-to-work/15186/2 "2014-01-10T03:55:55Z")

</div>

Try with adding ?routing=PARENTID  
where PARENTID is equal to the parent ID for a given child

HTH

--  
David 😉  
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 10 janv. 2014 à 01:09, Yuri Panchenko [yuri.panchenko@gmail.com](mailto:yuri.panchenko@gmail.com) a écrit :

Hi,

I'm doing a simple test with 1.0.0 Beta 2. I've indexed a parent record and three children. The head plugin shows all the children, and the search endpoint returns all three children with different id's. But, for some strange reason, I can only GET by id one of the children. Does someone have a clue, or could this be a bug?

curl -XGET localhost:9200/d3/transactions/\_search?pretty  
{  
"took" : 2,  
"timed\_out" : false,  
"\_shards" : {  
"total" : 5,  
"successful" : 5,  
"failed" : 0  
},  
"hits" : {  
"total" : 3,  
"max\_score" : 1.0,  
"hits" : [ {  
"\_index" : "d3",  
"\_type" : "transactions",  
"\_id" : "3",  
"\_score" : 1.0, "\_source" : { "date" : "2012-12-01", "description" : "Nail polish", "amount" : 80.00}  
}, {  
"\_index" : "d3",  
"\_type" : "transactions",  
"\_id" : "2",  
"\_score" : 1.0, "\_source" : { "date" : "2012-10-14", "description" : "Nail polish", "amount" : 70.00}  
}, {  
"\_index" : "d3",  
"\_type" : "transactions",  
"\_id" : "1",  
"\_score" : 1.0, "\_source" : { "date" : "2013-01-01", "description" : "Nail polish", "amount" : 75.50}  
} ]  
}  
}

curl -XGET localhost:9200/d3/transactions/1?pretty  
{  
"\_index" : "d3",  
"\_type" : "transactions",  
"\_id" : "1",  
"\_version" : 2,  
"exists" : true, "\_source" : { "date" : "2013-01-01", "description" : "Nail polish", "amount" : 75.50}  
}

curl -XGET localhost:9200/d3/transactions/2?pretty  
{  
"\_index" : "d3",  
"\_type" : "transactions",  
"\_id" : "2",  
"exists" : false  
}

curl -XGET localhost:9200/d3/transactions/3?pretty  
{  
"\_index" : "d3",  
"\_type" : "transactions",  
"\_id" : "3",  
"exists" : false  
}

--  
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/41376241-31ab-488a-bac8-19618cbc60be%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/41376241-31ab-488a-bac8-19618cbc60be%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](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+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/143F639E-7946-4F98-B003-B47FDD84F2C3%40pilato.fr](https://groups.google.com/d/msgid/elasticsearch/143F639E-7946-4F98-B003-B47FDD84F2C3%40pilato.fr).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![george\_monroe](https://avatars.discourse-cdn.com/v4/letter/g/bbce88/32.png) [@george\_monroe](https://discuss.elastic.co/u/george_monroe)\
**Post date:** [January 14, 2014, 3:27am UTC](https://discuss.elastic.co/t/1-0-0-beta2-get-children-for-parent-child-does-not-seem-to-work/15186/3 "2014-01-14T03:27:12Z")

</div>

Thanks David! Admittedly, this is counter intuitive and a little bit  
illogical. The reason is that I'm storing child docs in a different type,  
transactions (parent docs are going into type customers). Since child docs  
are indexed separately, logically, it would make sense to at least fetch  
them out without any reference to the parent docs. In fact, it seems that  
I can pull all of them out, but not individually.

Thanks anyway!!

On Thursday, January 9, 2014 7:55:55 PM UTC-8, David Pilato wrote:

> Try with adding ?routing=PARENTID  
> where PARENTID is equal to the parent ID for a given child
> 
> HTH
> 
> --  
> David 😉  
> Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
> 
> Le 10 janv. 2014 à 01:09, Yuri Panchenko \<[yuri.pa...@gmail.com](mailto:yuri.pa...@gmail.com)\<javascript:\>\>  
> a écrit :
> 
> Hi,
> 
> I'm doing a simple test with 1.0.0 Beta 2. I've indexed a parent record  
> and three children. The head plugin shows all the children, and the search  
> endpoint returns all three children with different id's. But, for some  
> strange reason, I can only GET by id one of the children. Does someone  
> have a clue, or could this be a bug?
> 
> curl -XGET localhost:9200/d3/transactions/\_search?pretty  
> {  
> "took" : 2,  
> "timed\_out" : false,  
> "\_shards" : {  
> "total" : 5,  
> "successful" : 5,  
> "failed" : 0  
> },  
> "hits" : {  
> "total" : 3,  
> "max\_score" : 1.0,  
> "hits" : [ {  
> "\_index" : "d3",  
> "\_type" : "transactions",  
> "\_id" : "3",  
> "\_score" : 1.0, "\_source" : { "date" : "2012-12-01", "description" :  
> "Nail polish", "amount" : 80.00}  
> }, {  
> "\_index" : "d3",  
> "\_type" : "transactions",  
> "\_id" : "2",  
> "\_score" : 1.0, "\_source" : { "date" : "2012-10-14", "description" :  
> "Nail polish", "amount" : 70.00}  
> }, {  
> "\_index" : "d3",  
> "\_type" : "transactions",  
> "\_id" : "1",  
> "\_score" : 1.0, "\_source" : { "date" : "2013-01-01", "description" :  
> "Nail polish", "amount" : 75.50}  
> } ]  
> }  
> }
> 
> curl -XGET localhost:9200/d3/transactions/1?pretty  
> {  
> "\_index" : "d3",  
> "\_type" : "transactions",  
> "\_id" : "1",  
> "\_version" : 2,  
> "exists" : true, "\_source" : { "date" : "2013-01-01", "description" :  
> "Nail polish", "amount" : 75.50}  
> }
> 
> curl -XGET localhost:9200/d3/transactions/2?pretty  
> {  
> "\_index" : "d3",  
> "\_type" : "transactions",  
> "\_id" : "2",  
> "exists" : false  
> }
> 
> curl -XGET localhost:9200/d3/transactions/3?pretty  
> {  
> "\_index" : "d3",  
> "\_type" : "transactions",  
> "\_id" : "3",  
> "exists" : false  
> }
> 
> --  
> 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/41376241-31ab-488a-bac8-19618cbc60be%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/41376241-31ab-488a-bac8-19618cbc60be%40googlegroups.com)  
> .  
> For more options, visit [https://groups.google.com/groups/opt\_out](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+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/21b21844-656d-440f-9277-b97a5ddfde0c%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/21b21844-656d-440f-9277-b97a5ddfde0c%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:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [January 14, 2014, 6:02am UTC](https://discuss.elastic.co/t/1-0-0-beta2-get-children-for-parent-child-does-not-seem-to-work/15186/4 "2014-01-14T06:02:48Z")

</div>

Children are colocated in the same shard as parents for performance reason.

--  
David 😉  
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 14 janv. 2014 à 04:27, Yuri Panchenko [yuri.panchenko@gmail.com](mailto:yuri.panchenko@gmail.com) a écrit :

Thanks David! Admittedly, this is counter intuitive and a little bit illogical. The reason is that I'm storing child docs in a different type, transactions (parent docs are going into type customers). Since child docs are indexed separately, logically, it would make sense to at least fetch them out without any reference to the parent docs. In fact, it seems that I can pull all of them out, but not individually.

Thanks anyway!!

> On Thursday, January 9, 2014 7:55:55 PM UTC-8, David Pilato wrote:  
> Try with adding ?routing=PARENTID  
> where PARENTID is equal to the parent ID for a given child
> 
> HTH
> 
> --  
> David 😉  
> Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
> 
> Le 10 janv. 2014 à 01:09, Yuri Panchenko [yuri.pa...@gmail.com](mailto:yuri.pa...@gmail.com) a écrit :
> 
> Hi,
> 
> I'm doing a simple test with 1.0.0 Beta 2. I've indexed a parent record and three children. The head plugin shows all the children, and the search endpoint returns all three children with different id's. But, for some strange reason, I can only GET by id one of the children. Does someone have a clue, or could this be a bug?
> 
> curl -XGET localhost:9200/d3/transactions/\_search?pretty  
> {  
> "took" : 2,  
> "timed\_out" : false,  
> "\_shards" : {  
> "total" : 5,  
> "successful" : 5,  
> "failed" : 0  
> },  
> "hits" : {  
> "total" : 3,  
> "max\_score" : 1.0,  
> "hits" : [ {  
> "\_index" : "d3",  
> "\_type" : "transactions",  
> "\_id" : "3",  
> "\_score" : 1.0, "\_source" : { "date" : "2012-12-01", "description" : "Nail polish", "amount" : 80.00}  
> }, {  
> "\_index" : "d3",  
> "\_type" : "transactions",  
> "\_id" : "2",  
> "\_score" : 1.0, "\_source" : { "date" : "2012-10-14", "description" : "Nail polish", "amount" : 70.00}  
> }, {  
> "\_index" : "d3",  
> "\_type" : "transactions",  
> "\_id" : "1",  
> "\_score" : 1.0, "\_source" : { "date" : "2013-01-01", "description" : "Nail polish", "amount" : 75.50}  
> } ]  
> }  
> }
> 
> curl -XGET localhost:9200/d3/transactions/1?pretty  
> {  
> "\_index" : "d3",  
> "\_type" : "transactions",  
> "\_id" : "1",  
> "\_version" : 2,  
> "exists" : true, "\_source" : { "date" : "2013-01-01", "description" : "Nail polish", "amount" : 75.50}  
> }
> 
> curl -XGET localhost:9200/d3/transactions/2?pretty  
> {  
> "\_index" : "d3",  
> "\_type" : "transactions",  
> "\_id" : "2",  
> "exists" : false  
> }
> 
> curl -XGET localhost:9200/d3/transactions/3?pretty  
> {  
> "\_index" : "d3",  
> "\_type" : "transactions",  
> "\_id" : "3",  
> "exists" : false  
> }
> 
> --  
> 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).  
> To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/41376241-31ab-488a-bac8-19618cbc60be%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/41376241-31ab-488a-bac8-19618cbc60be%40googlegroups.com).  
> For more options, visit [https://groups.google.com/groups/opt\_out](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+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/21b21844-656d-440f-9277-b97a5ddfde0c%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/21b21844-656d-440f-9277-b97a5ddfde0c%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](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+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/85E03D0F-4451-4110-973F-06BD52E0B10A%40pilato.fr](https://groups.google.com/d/msgid/elasticsearch/85E03D0F-4451-4110-973F-06BD52E0B10A%40pilato.fr).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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:57am UTC](https://discuss.elastic.co/t/1-0-0-beta2-get-children-for-parent-child-does-not-seem-to-work/15186/5 "2017-07-06T01:57:04Z")

</div>


