# Specify Routing on Index Alias's Term Lookup Filter

**URL:** <https://discuss.elastic.co/t/specify-routing-on-index-aliass-term-lookup-filter/17353>\
**Category:** Elasticsearch\
**Created:** [May 5, 2014, 3:13pm UTC](https://discuss.elastic.co/t/specify-routing-on-index-aliass-term-lookup-filter/17353 "2014-05-05T15:13:37Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Carlos\_Vializ](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/carlos_vializ/32/1602_2.png) [@Carlos\_Vializ](https://discuss.elastic.co/u/Carlos_Vializ)\
**Post date:** [May 5, 2014, 3:13pm UTC](https://discuss.elastic.co/t/specify-routing-on-index-aliass-term-lookup-filter/17353/1 "2014-05-05T15:13:37Z")

</div>

I made a post on StackOverflow, but I think the visibility there is low for  
ElasticSearch problems. I've copied the text here

I am using _Logstash_, _ElasticSearch_ and _Kibana_ to allow multiple users  
to log in and view the log data they have forwarded. I have created index  
aliases for each user. These restrict their results to contain only their  
own data.

I'd like to assign users to groups, and allow users to view data for the  
computers in their group. I created a parent-child relationship between the  
groups and the users, and I created a term lookup filter on the alias.

My problem is, I receive a RoutingMissingException when I try to apply the  
alias.

Is there a way to specify the routing for the term lookup filter? How can I  
lookup terms on a parent document?

I posted the mapping and alias below, but a full gist recreation is  
available at this link [https://gist.github.com/cvializ/11294031](https://gist.github.com/cvializ/11294031).

curl -XPUT '[http://localhost:9200/accesscontrol/](http://localhost:9200/accesscontrol/)' -d '{  
"mappings" : {  
"group" : {  
"properties" : {  
"name" : { "type" : "string" },  
"hosts" : { "type" : "string" }  
}  
},  
"user" : {  
"\_parent" : { "type" : "group" },  
"\_routing" : { "required" : true, "path" : "group\_id" },  
"properties" : {  
"name" : { "type" : "string" },  
"group\_id" : { "type" : "string" }  
}  
}  
}}'

# Create the logstash alias for cvializ

curl -XPOST '[http://localhost:9200/\_aliases](http://localhost:9200/_aliases)' -d '{  
"actions" : [  
{ "remove" : { "index" : "logstash-2014.04.25", "alias" : "cvializ-logstash-2014.04.25" } },  
{  
"add" : {  
"index" : "logstash-2014.04.25",  
"alias" : "cvializ-logstash-2014.04.25",  
"routing" : "intern",  
"filter": {  
"terms" : {  
"host" : {  
"index" : "accesscontrol",  
"type" : "user",  
"id" : "cvializ",  
"path" : "group.hosts"  
},  
"\_cache\_key" : "cvializ\_hosts"  
}  
}  
}  
}  
]}'

--  
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/66cab474-f33e-47b0-a0de-64845bb95600%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/66cab474-f33e-47b0-a0de-64845bb95600%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:31am UTC](https://discuss.elastic.co/t/specify-routing-on-index-aliass-term-lookup-filter/17353/2 "2017-07-06T01:31:37Z")

</div>

Closed on July 6, 2017, 1:31am UTC


