Aliases help to avoid developper bugs! Basically, imagine you forgot to apply the filter in one of your queries… Your user will see everything. Also, aliases might help you to secure your access to users data. If you are using Nginx or Shield, you can say that this user A has only access to localhost:9200/a which is an alias.
I meant that users data can be assigned to any shard but all documents will go to the same shard whichever it is. Let say you have 2 shards in index named docs. All docs for user A will go to shard 0 All docs for user B will go to shard 1 All docs for user C will go to shard 0 All docs for user D will go to shard 1 If you query index docs, you have access to all docs. If you query index docs with routing A or C, you will have access to docs for users A AND C If you query index docs with routing A or C with a filter A, you will have access to docs for users A only. If you define an alias A with routing A and filter on A, then if you query alias A you will have access to docs for users A only. You can read the Definitive guide and in particular this section: http://www.elastic.co/guide/en/elasticsearch/guide/current/scale.html <http://www.elastic.co/guide/en/elasticsearch/guide/current/scale.html> http://www.elastic.co/guide/en/elasticsearch/guide/current/faking-it.html <http://www.elastic.co/guide/en/elasticsearch/guide/current/faking-it.html> -- David Pilato - Developer | Evangelist elastic.co @dadoonet <https://twitter.com/dadoonet> | @elasticsearchfr <https://twitter.com/elasticsearchfr> | @scrutmydocs <https://twitter.com/scrutmydocs> > Le 23 avr. 2015 à 10:05, Zaid Amir <redserpe...@gmail.com> a écrit : > > So then what is the benefit of using aliases as opposed to using one index > and filtered queries? From what I've read, aliases and routing can give a > boost in queries since the index knows on which shards the documents are > located, but now you are saying that it does not matter since users' data can > be assigned to any shard. Is that correct? > > > -- > 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+unsubscr...@googlegroups.com > <mailto:elasticsearch+unsubscr...@googlegroups.com>. > To view this discussion on the web visit > https://groups.google.com/d/msgid/elasticsearch/ece778a2-d8ed-4601-bca2-8f0237da42e3%40googlegroups.com > > <https://groups.google.com/d/msgid/elasticsearch/ece778a2-d8ed-4601-bca2-8f0237da42e3%40googlegroups.com?utm_medium=email&utm_source=footer>. > For more options, visit https://groups.google.com/d/optout > <https://groups.google.com/d/optout>. -- 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+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/65AA0604-EEA1-4120-BEE3-2446B2FC453C%40pilato.fr. For more options, visit https://groups.google.com/d/optout.