# Dynamic Filtered Index Aliases

**URL:** <https://discuss.elastic.co/t/dynamic-filtered-index-aliases/18614>\
**Category:** Elasticsearch\
**Created:** [July 11, 2014, 8:29pm UTC](https://discuss.elastic.co/t/dynamic-filtered-index-aliases/18614 "2014-07-11T20:29:37Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![John\_Cherniavsky](https://avatars.discourse-cdn.com/v4/letter/j/49beb7/32.png) [@John\_Cherniavsky](https://discuss.elastic.co/u/John_Cherniavsky)\
**Post date:** [July 11, 2014, 8:29pm UTC](https://discuss.elastic.co/t/dynamic-filtered-index-aliases/18614/1 "2014-07-11T20:29:37Z")

</div>

I'm looking to deploy what is effectively user segmentation of my data. I  
have a moderately high number of users (say 10K), and I want each to be  
able to query an alias that is their own.

This is not meant as a security measure, but as a backstop. Developers on  
my team will not try to guess another user's index name, but I don't want  
to count on every query remembering to add user filtering.

From the docs

* * *

## curl -XPOST '[http://localhost:9200/\_aliases](http://localhost:9200/_aliases)' -d ' { "actions" : [{ "add" : { "index" : "test1", "alias" : "alias2", "filter" : { "term" : { "user" : "kimchy" } } } }] }

Is what I want except that I want the term == alias so

* * *

## curl -XPOST '[http://localhost:9200/](http://localhost:9200/)_aliases' -d ' { "actions" : [{ "add" : { "index" : "test1", "alias" : "alias_[X]", "filter" : { "term" : { "user" : [X] } } } } ] }

then

[http://localhost:9200/alias\_bob/\_search](http://localhost:9200/alias_bob/_search)

would let you search only bob's data

Does ES have anything like this? Is it coming?

Thanks,  
John

--  
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/99901585-e0f5-4905-82d6-632586e96db2%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/99901585-e0f5-4905-82d6-632586e96db2%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:16am UTC](https://discuss.elastic.co/t/dynamic-filtered-index-aliases/18614/2 "2017-07-06T01:16:23Z")

</div>


