# External routing \[76\] and document path routing \[khabar\] mismatch

**URL:** <https://discuss.elastic.co/t/external-routing-76-and-document-path-routing-khabar-mismatch/16369>\
**Category:** Elasticsearch\
**Created:** [March 14, 2014, 2:30am UTC](https://discuss.elastic.co/t/external-routing-76-and-document-path-routing-khabar-mismatch/16369 "2014-03-14T02:30:12Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Robin\_Boutros](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/robin_boutros/32/1727_2.png) [@Robin\_Boutros](https://discuss.elastic.co/u/Robin_Boutros)\
**Post date:** [March 14, 2014, 2:30am UTC](https://discuss.elastic.co/t/external-routing-76-and-document-path-routing-khabar-mismatch/16369/1 "2014-03-14T02:30:12Z")

</div>

Hey,

I have a parent/child relationship between Item and Player.

{  
"item": {  
"\_parent": {  
"type": "player"  
},  
"\_routing": {  
"required":true,  
"path":"account"  
},  
"properties": {

"account":{"type":"string","index":"not\_analyzed","omit\_norms":true,"index\_options":"docs"}  
}  
}  
}

{  
"player": {  
"\_routing": {  
"required":true,  
"path":"account"  
},  
"properties": {

{"type":"string","index":"not\_analyzed","omit\_norms":true,"index\_options":"docs"}

```
  }

```

}  
}

Ok, so with this, I'm hoping to have items indexed on the same shard as  
their parents.

But when I try to save an item, I get this error:

_External routing [1] and document path routing [Frank1234r] mismatch_

\*Frank1234r \*is the account name, and \*1 \*is the id of the player with the  
name.

What do I need to do to fix that? What the "external routing" exactly?  
Thanks!

--  
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/46a626e8-abed-4e13-9e33-3f42a1f379a3%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/46a626e8-abed-4e13-9e33-3f42a1f379a3%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Robin\_Boutros](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/robin_boutros/32/1727_2.png) [@Robin\_Boutros](https://discuss.elastic.co/u/Robin_Boutros)\
**Post date:** [March 14, 2014, 2:36am UTC](https://discuss.elastic.co/t/external-routing-76-and-document-path-routing-khabar-mismatch/16369/2 "2014-03-14T02:36:24Z")

</div>

Something to add:

When I index an item, I reference his parent with its id, not his account  
name. Is that part of the problem? Can I use the account to set the item's  
parent when indexing it? And if so, how would elasticsearch know that I'm  
using this field?

On Thursday, March 13, 2014 10:30:12 PM UTC-4, Robin Boutros wrote:

> Hey,
> 
> I have a parent/child relationship between Item and Player.
> 
> {  
> "item": {  
> "\_parent": {  
> "type": "player"  
> },  
> "\_routing": {  
> "required":true,  
> "path":"account"  
> },  
> "properties": {
> 
> "account":{"type":"string","index":"not\_analyzed","omit\_norms":true,"index\_options":"docs"}  
> }  
> }  
> }
> 
> {  
> "player": {  
> "\_routing": {  
> "required":true,  
> "path":"account"  
> },  
> "properties": {
> 
> {"type":"string","index":"not\_analyzed","omit\_norms":true,"index\_options":"docs"}
> 
> ```
> }
> 
> ```
> 
> }  
> }
> 
> Ok, so with this, I'm hoping to have items indexed on the same shard as  
> their parents.
> 
> But when I try to save an item, I get this error:
> 
> _External routing [1] and document path routing [Frank1234r] mismatch_
> 
> \*Frank1234r \*is the account name, and \*1 \*is the id of the player with  
> the name.
> 
> What do I need to do to fix that? What the "external routing" exactly?  
> Thanks!

--  
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/8b4e0c5a-d477-42fc-bf1e-846efafc195f%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/8b4e0c5a-d477-42fc-bf1e-846efafc195f%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Robin\_Boutros](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/robin_boutros/32/1727_2.png) [@Robin\_Boutros](https://discuss.elastic.co/u/Robin_Boutros)\
**Post date:** [March 15, 2014, 9:00pm UTC](https://discuss.elastic.co/t/external-routing-76-and-document-path-routing-khabar-mismatch/16369/3 "2014-03-15T21:00:00Z")

</div>

I actually managed to make it work, by providing the routing as a query  
parameter when indexing my items.

On Thursday, March 13, 2014 10:36:24 PM UTC-4, Robin Boutros wrote:

> Something to add:
> 
> When I index an item, I reference his parent with its id, not his account  
> name. Is that part of the problem? Can I use the account to set the item's  
> parent when indexing it? And if so, how would elasticsearch know that I'm  
> using this field?
> 
> On Thursday, March 13, 2014 10:30:12 PM UTC-4, Robin Boutros wrote:
> 
> > Hey,
> > 
> > I have a parent/child relationship between Item and Player.
> > 
> > {  
> > "item": {  
> > "\_parent": {  
> > "type": "player"  
> > },  
> > "\_routing": {  
> > "required":true,  
> > "path":"account"  
> > },  
> > "properties": {
> > 
> > "account":{"type":"string","index":"not\_analyzed","omit\_norms":true,"index\_options":"docs"}  
> > }  
> > }  
> > }
> > 
> > {  
> > "player": {  
> > "\_routing": {  
> > "required":true,  
> > "path":"account"  
> > },  
> > "properties": {
> > 
> > {"type":"string","index":"not\_analyzed","omit\_norms":true,"index\_options":"docs"}
> > 
> > ```
> > }
> > 
> > ```
> > 
> > }  
> > }
> > 
> > Ok, so with this, I'm hoping to have items indexed on the same shard as  
> > their parents.
> > 
> > But when I try to save an item, I get this error:
> > 
> > _External routing [1] and document path routing [Frank1234r] mismatch_
> > 
> > \*Frank1234r \*is the account name, and \*1 \*is the id of the player with  
> > the name.
> > 
> > What do I need to do to fix that? What the "external routing" exactly?  
> > Thanks!

--  
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/f165b957-17fa-4b03-ba31-9dceee482826%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/f165b957-17fa-4b03-ba31-9dceee482826%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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:43am UTC](https://discuss.elastic.co/t/external-routing-76-and-document-path-routing-khabar-mismatch/16369/4 "2017-07-06T01:43:00Z")

</div>


