# Issues with alias/routing name

**URL:** <https://discuss.elastic.co/t/issues-with-alias-routing-name/22983>\
**Category:** Elasticsearch\
**Created:** [March 30, 2015, 3:51pm UTC](https://discuss.elastic.co/t/issues-with-alias-routing-name/22983 "2015-03-30T15:51:04Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sebastian\_2](https://avatars.discourse-cdn.com/v4/letter/s/e0b2c6/32.png) [@sebastian\_2](https://discuss.elastic.co/u/sebastian_2)\
**Post date:** [March 30, 2015, 3:51pm UTC](https://discuss.elastic.co/t/issues-with-alias-routing-name/22983/1 "2015-03-30T15:51:04Z")

</div>

Hi,

I created the following alias/routing ("users" is the index name, "user" is  
the type name):

{  
"users": {  
"aliases": {  
"acme": {  
"filter": {  
"term": {  
"tenant": "acme"  
}  
},  
"index\_routing": "acme",  
"search\_routing": "acme"  
}  
}  
}  
}

And everything works OK:

curl -XGET '[http://localhost:9200/acme/user/\_count](http://localhost:9200/acme/user/_count)'

{"count":8, "\_shards": {"total":5,"successful":5,"failed":0}}

But if the alias name has a '-' char:

{  
"users": {  
"aliases": {  
"foo-bar": {  
"filter": {  
"term": {  
"tenant": "foo-bar"  
}  
},  
"index\_routing": "foo-bar",  
"search\_routing": "foo-bar"  
}  
}  
}  
}

The routing is not working:

curl -XGET '[http://localhost:9200/foo-bar/user/\_count](http://localhost:9200/foo-bar/user/_count)'

{"count":0, "\_shards": {"total":5,"successful":5,"failed":0}}

curl -XGET '[http://localhost:9200/users/user/\_count?q=tenant:"foo-bar"](http://localhost:9200/users/user/_count?q=tenant:%22foo-bar%22)'

{"count":15, "\_shards": {"total":5, "successful":5, "failed":0}}

Any clues?

--  
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/98476ebe-b426-418e-9597-c821de56cc6f%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/98476ebe-b426-418e-9597-c821de56cc6f%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, 12:23am UTC](https://discuss.elastic.co/t/issues-with-alias-routing-name/22983/2 "2017-07-06T00:23:04Z")

</div>


