Using index aliases

Real world applications have a lot of indices and queries that span on more indices. This scenario requires defining all the indices names on which we need to perform queries; aliases allow grouping them by a common name.

Some common scenarios of this usage are:

  • Log indices divided by date (such as log_YYMMDD) for which we want to create an alias for the last week, the last month, today, yesterday, and so on. This pattern is commonly used in log applications such as logstash (http://logstash.net/).
  • Collecting website contents in several indices (New York Times, The Guardian, and so on) for those we want to refer to as an index aliases called sites.

Getting ready

You will need a working ElasticSearch cluster.

How to do it...

The URL ...

Get ElasticSearch Cookbook - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.