# Issue with multiple shards and parent / child Edit

**URL:** <https://discuss.elastic.co/t/issue-with-multiple-shards-and-parent-child-edit/13851>\
**Category:** Elasticsearch\
**Created:** [October 4, 2013, 9:07pm UTC](https://discuss.elastic.co/t/issue-with-multiple-shards-and-parent-child-edit/13851 "2013-10-04T21:07:04Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![benjamin\_roth](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/benjamin_roth/32/2057_2.png) [@benjamin\_roth](https://discuss.elastic.co/u/benjamin_roth)\
**Post date:** [October 4, 2013, 9:07pm UTC](https://discuss.elastic.co/t/issue-with-multiple-shards-and-parent-child-edit/13851/1 "2013-10-04T21:07:04Z")

</div>

Hi,

I've nested documents, everything is fine in dev since I've only one shard,  
but in production it fails with the following message:

{"error"=\>"RoutingMissingException[routing is required for [users]/[timeline\_post]/[1]]", "status"=\>500}

The logged query is:

curl -X POST "[http://foo.qbox.io/users/timeline\_post/1?parent=23](http://foo.qbox.io/users/timeline_post/1?parent=23)" -d '{"id":1,"body":"foo"}'

I thought there were no need to specify routing if the parent is provided.

Any idea what's wrong here please?

Thanks,

Ben

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [October 6, 2013, 5:26pm UTC](https://discuss.elastic.co/t/issue-with-multiple-shards-and-parent-child-edit/13851/2 "2013-10-06T17:26:26Z")

</div>

Hey,

can you share more information about your sample (also I am not sure if  
qbox is doing anything special though). Your mapping would be especially  
interesting. Also, does this problem occur in your dev setup as well, if  
you have several shards?

In addition: If you specify a parent, and no routing is specified, the  
parent is used for routing. You can try to set parent and routing and try  
if this changes anything in your setup.

--Alex

On Fri, Oct 4, 2013 at 11:07 PM, [benjamin.roth@peachyweb.com](mailto:benjamin.roth@peachyweb.com) wrote:

> Hi,
> 
> I've nested documents, everything is fine in dev since I've only one  
> shard, but in production it fails with the following message:
> 
> {"error"=\>"RoutingMissingException[routing is required for [users]/[timeline\_post]/[1]]", "status"=\>500}
> 
> The logged query is:
> 
> curl -X POST "[http://foo.qbox.io/users/timeline\_post/1?parent=23](http://foo.qbox.io/users/timeline_post/1?parent=23)" -d '{"id":1,"body":"foo"}'
> 
> I thought there were no need to specify routing if the parent is provided.
> 
> Any idea what's wrong here please?
> 
> Thanks,
> 
> Ben
> 
> --  
> 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).  
> 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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![benjamin\_roth](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/benjamin_roth/32/2057_2.png) [@benjamin\_roth](https://discuss.elastic.co/u/benjamin_roth)\
**Post date:** [October 6, 2013, 5:54pm UTC](https://discuss.elastic.co/t/issue-with-multiple-shards-and-parent-child-edit/13851/3 "2013-10-06T17:54:18Z")

</div>

Hi Alex,

Thanks for your interest in my question.  
Everything works fine in dev env but I have only one shard. Will try to use  
explicit routing.

In the meantime, here are my indexes:

[http://foo.qbox.io/users/user/\_mapping](http://foo.qbox.io/users/user/_mapping)

{

- user:  
{
  - properties:  
{
    - id:  
{
      - type: "integer"  
},

    - name:  
{
      - type: "string",
      - analyzer: "snowball"  
},

    - lat\_lon:  
{
      - type: "geo\_point"  
}  
}  
}

}

http:/foo.qbox.io/users/timeline\_post/\_mapping

{

- timeline\_post:  
{
  - \_parent:  
{
    - type: "user"  
},

  - \_routing:  
{
    - required: true  
},

  - properties:  
{
    - body:  
{
      - type: "string",
      - analyzer: "snowball"  
},

    - id:  
{
      - type: "integer"  
}  
}  
}

}

On Sunday, October 6, 2013 7:26:26 PM UTC+2, Alexander Reelsen wrote:

> Hey,
> 
> can you share more information about your sample (also I am not sure if  
> qbox is doing anything special though). Your mapping would be especially  
> interesting. Also, does this problem occur in your dev setup as well, if  
> you have several shards?
> 
> In addition: If you specify a parent, and no routing is specified, the  
> parent is used for routing. You can try to set parent and routing and try  
> if this changes anything in your setup.
> 
> --Alex
> 
> On Fri, Oct 4, 2013 at 11:07 PM, \<[benjam...@peachyweb.com](mailto:benjam...@peachyweb.com) \<javascript:\>\>wrote:
> 
> > Hi,
> > 
> > I've nested documents, everything is fine in dev since I've only one  
> > shard, but in production it fails with the following message:
> > 
> > {"error"=\>"RoutingMissingException[routing is required for [users]/[timeline\_post]/[1]]", "status"=\>500}
> > 
> > The logged query is:
> > 
> > curl -X POST "[http://foo.qbox.io/users/timeline\_post/1?parent=23](http://foo.qbox.io/users/timeline_post/1?parent=23)" -d '{"id":1,"body":"foo"}'
> > 
> > I thought there were no need to specify routing if the parent is provided.
> > 
> > Any idea what's wrong here please?
> > 
> > Thanks,
> > 
> > Ben
> > 
> > --  
> > 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:\>.  
> > 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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [October 6, 2013, 8:32pm UTC](https://discuss.elastic.co/t/issue-with-multiple-shards-and-parent-child-edit/13851/4 "2013-10-06T20:32:38Z")

</div>

Hey,

it is not a single shard problem. You can easily fire up your elasticsearch  
instance and create an index with 10 shards, and use the parent parameter  
like this:

curl -X DELETE localhost:9200/test/  
curl -X PUT localhost:9200/test/ -d '{ "settings" : {  
"index.number\_of\_shards" : 10 } }'

curl -X PUT localhost:9200/test/user/\_mapping -d '{  
"user": {  
"properties": {  
"id": { "type": "integer" },  
"name": { "type": "string", "analyzer": "snowball" },  
"lat\_lon": { "type": "geo\_point" }  
}  
}  
}'

curl -X PUT localhost:9200/test/timeline\_post/\_mapping -d '{  
"timeline\_post": {  
"\_parent": { "type": "user" },  
"\_routing": { "required": true },  
"properties": {  
"body": { "type": "string", "analyzer": "snowball" },  
"id": { "type": "integer" }  
}  
}  
}'

curl -X PUT 'localhost:9200/test/timeline\_post/1?parent=12' -d '{  
"foo":"bar" }'

So, maybe I have done something different to your problem or maybe want to  
ask the company running the hosted search if there is something special we  
dont cater for here.

--Alex

On Sun, Oct 6, 2013 at 7:54 PM, [benjamin.roth@peachyweb.com](mailto:benjamin.roth@peachyweb.com) wrote:

> Hi Alex,
> 
> Thanks for your interest in my question.  
> Everything works fine in dev env but I have only one shard. Will try to  
> use explicit routing.
> 
> In the meantime, here are my indexes:
> 
> [http://foo.qbox.io/users/user/\_mapping](http://foo.qbox.io/users/user/_mapping)
> 
> {
> 
> - user:  
> {
> - properties:  
> {
> - id:  
> {
> - type: "integer"  
> },
> 
> - name:  
> {
> - type: "string",
> - analyzer: "snowball"  
> },
> 
> - lat\_lon:  
> {
> - type: "geo\_point"  
> }  
> }  
> }
> 
> }
> 
> http:/foo.qbox.io/users/timeline\_post/\_mapping
> 
> {
> 
> - timeline\_post:  
> {
> - \_parent:  
> {
> - type: "user"  
> },
> 
> - \_routing:  
> {
> - required: true  
> },
> 
> - properties:  
> {
> - body:  
> {
> - type: "string",
> - analyzer: "snowball"  
> },
> 
> - id:  
> {
> - type: "integer"  
> }  
> }  
> }
> 
> }
> 
> On Sunday, October 6, 2013 7:26:26 PM UTC+2, Alexander Reelsen wrote:
> 
> > Hey,
> > 
> > can you share more information about your sample (also I am not sure if  
> > qbox is doing anything special though). Your mapping would be especially  
> > interesting. Also, does this problem occur in your dev setup as well, if  
> > you have several shards?
> > 
> > In addition: If you specify a parent, and no routing is specified, the  
> > parent is used for routing. You can try to set parent and routing and try  
> > if this changes anything in your setup.
> > 
> > --Alex
> > 
> > On Fri, Oct 4, 2013 at 11:07 PM, [benjam...@peachyweb.com](mailto:benjam...@peachyweb.com) wrote:
> > 
> > > Hi,
> > > 
> > > I've nested documents, everything is fine in dev since I've only one  
> > > shard, but in production it fails with the following message:
> > > 
> > > {"error"=\>"\*\*RoutingMissingException[\*\*routing is required for [users]/[timeline\_post]/[1]]", "status"=\>500}
> > > 
> > > The logged query is:
> > > 
> > > curl -X POST "[http://foo.qbox.io/users/\*\*timeline\_post/1?parent=23](http://foo.qbox.io/users/**timeline_post/1?parent=23) [http://foo.qbox.io/users/timeline\_post/1?parent=23](http://foo.qbox.io/users/timeline_post/1?parent=23)" -d '{"id":1,"body":"foo"}'
> > > 
> > > I thought there were no need to specify routing if the parent is  
> > > provided.
> > > 
> > > Any idea what's wrong here please?
> > > 
> > > Thanks,
> > > 
> > > Ben
> > > 
> > > --  
> > > 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](http://googlegroups.com).
> > > 
> > > For more options, visit [https://groups.google.com/\*\*groups/opt\_out](https://groups.google.com/**groups/opt_out)[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).  
> > 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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![benjamin\_roth](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/benjamin_roth/32/2057_2.png) [@benjamin\_roth](https://discuss.elastic.co/u/benjamin_roth)\
**Post date:** [October 8, 2013, 2:48pm UTC](https://discuss.elastic.co/t/issue-with-multiple-shards-and-parent-child-edit/13851/5 "2013-10-08T14:48:54Z")

</div>

Thanks to your expertise, I've contacted qbox support and it was an issue  
on their side. They are working on it now.

Thanks Alexander!

On Sunday, October 6, 2013 10:32:38 PM UTC+2, Alexander Reelsen wrote:

> Hey,
> 
> it is not a single shard problem. You can easily fire up your  
> elasticsearch instance and create an index with 10 shards, and use the  
> parent parameter like this:
> 
> curl -X DELETE localhost:9200/test/  
> curl -X PUT localhost:9200/test/ -d '{ "settings" : {  
> "index.number\_of\_shards" : 10 } }'
> 
> curl -X PUT localhost:9200/test/user/\_mapping -d '{  
> "user": {  
> "properties": {  
> "id": { "type": "integer" },  
> "name": { "type": "string", "analyzer": "snowball" },  
> "lat\_lon": { "type": "geo\_point" }  
> }  
> }  
> }'
> 
> curl -X PUT localhost:9200/test/timeline\_post/\_mapping -d '{  
> "timeline\_post": {  
> "\_parent": { "type": "user" },  
> "\_routing": { "required": true },  
> "properties": {  
> "body": { "type": "string", "analyzer": "snowball" },  
> "id": { "type": "integer" }  
> }  
> }  
> }'
> 
> curl -X PUT 'localhost:9200/test/timeline\_post/1?parent=12' -d '{  
> "foo":"bar" }'
> 
> So, maybe I have done something different to your problem or maybe want to  
> ask the company running the hosted search if there is something special we  
> dont cater for here.
> 
> --Alex
> 
> On Sun, Oct 6, 2013 at 7:54 PM, \<[benjam...@peachyweb.com](mailto:benjam...@peachyweb.com) \<javascript:\>\>wrote:
> 
> > Hi Alex,
> > 
> > Thanks for your interest in my question.  
> > Everything works fine in dev env but I have only one shard. Will try to  
> > use explicit routing.
> > 
> > In the meantime, here are my indexes:
> > 
> > [http://foo.qbox.io/users/user/\_mapping](http://foo.qbox.io/users/user/_mapping)
> > 
> > {
> > 
> > - user:  
> > {
> > - properties:  
> > {
> > - id:  
> > {
> > - type: "integer"  
> > },
> > 
> > - name:  
> > {
> > - type: "string",
> > - analyzer: "snowball"  
> > },
> > 
> > - lat\_lon:  
> > {
> > - type: "geo\_point"  
> > }  
> > }  
> > }
> > 
> > }
> > 
> > http:/foo.qbox.io/users/timeline\_post/\_mapping
> > 
> > {
> > 
> > - timeline\_post:  
> > {
> > - \_parent:  
> > {
> > - type: "user"  
> > },
> > 
> > - \_routing:  
> > {
> > - required: true  
> > },
> > 
> > - properties:  
> > {
> > - body:  
> > {
> > - type: "string",
> > - analyzer: "snowball"  
> > },
> > 
> > - id:  
> > {
> > - type: "integer"  
> > }  
> > }  
> > }
> > 
> > }
> > 
> > On Sunday, October 6, 2013 7:26:26 PM UTC+2, Alexander Reelsen wrote:
> > 
> > > Hey,
> > > 
> > > can you share more information about your sample (also I am not sure if  
> > > qbox is doing anything special though). Your mapping would be especially  
> > > interesting. Also, does this problem occur in your dev setup as well, if  
> > > you have several shards?
> > > 
> > > In addition: If you specify a parent, and no routing is specified, the  
> > > parent is used for routing. You can try to set parent and routing and try  
> > > if this changes anything in your setup.
> > > 
> > > --Alex
> > > 
> > > On Fri, Oct 4, 2013 at 11:07 PM, [benjam...@peachyweb.com](mailto:benjam...@peachyweb.com) wrote:
> > > 
> > > > Hi,
> > > > 
> > > > I've nested documents, everything is fine in dev since I've only one  
> > > > shard, but in production it fails with the following message:
> > > > 
> > > > {"error"=\>"\*\*RoutingMissingException[\*\*routing is required for [users]/[timeline\_post]/[1]]", "status"=\>500}
> > > > 
> > > > The logged query is:
> > > > 
> > > > curl -X POST "[http://foo.qbox.io/users/\*\*timeline\_post/1?parent=23](http://foo.qbox.io/users/**timeline_post/1?parent=23) [http://foo.qbox.io/users/timeline\_post/1?parent=23](http://foo.qbox.io/users/timeline_post/1?parent=23)" -d '{"id":1,"body":"foo"}'
> > > > 
> > > > I thought there were no need to specify routing if the parent is  
> > > > provided.
> > > > 
> > > > Any idea what's wrong here please?
> > > > 
> > > > Thanks,
> > > > 
> > > > Ben
> > > > 
> > > > --  
> > > > 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](http://googlegroups.com).
> > > > 
> > > > For more options, visit [https://groups.google.com/\*\*groups/opt\_out](https://groups.google.com/**groups/opt_out)[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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> > > 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).  
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, 2:13am UTC](https://discuss.elastic.co/t/issue-with-multiple-shards-and-parent-child-edit/13851/6 "2017-07-06T02:13:20Z")

</div>


