Are index aliases and wildcard index endpoints in Elasticsearch exactly the same thing? Are index aliases and wildcard index endpoints in Elasticsearch exactly the same thing? elasticsearch elasticsearch

Are index aliases and wildcard index endpoints in Elasticsearch exactly the same thing?


They aren't exactly the same, from a code execution perspective. But they are functionally identical and will have identical performance profiles.

Aliases are really just "tags" that are attached to existing indices. So when you search against the 2014 alias, Elasticsearch just scans through the list of indices in the cluster state and finds all indices that are tagged with that alias.

When you search against a wildcard index pattern, it scans through the list of indices to see which names match the regex.

So performance will basically be the same, because the actual search is entirely unaffected: the shards associated with those searches will be queried no matter what, and all the index-to-shard lookups will happen on the coordinating node very quickly, no matter the method used.

So don't worry, you can choose whichever makes more sense for you :)

PS. Wildcard queries are discouraged because they do have performance implications. They have to generate and check a large number of potential tokens, which can have non-negligible impact on latency. But they are very different from index wildcards, or many other wildcards around ES. Most things that support pattern matching / wildcards in ES are simply Java regex, whereas the wildcard query is fancy automaton magic inside of Lucene against inverted indices...much different :)