TIL Elastic Search Index Aliases allow zero-dowtime re-indexing

Oliver Peate posted on January 11th, 2019

Elastic Search has an Index Aliases feature which is really handy for re-indexing with zero-downtime. An example flow could include:

  1. Create / populate the new index (widgets_2019_11_01_13_44_22)
  2. Update the current_widgets alias (used for querying / other operations) to:
    • Delete references to all previous indexes using a wildcard (widgets_*)
    • Reference the new index widgets_2019_11_01_13_44_22
  3. Delete the previous indexes, except the new one (widgets_*,-widgets_2019_11_01_13_44_22)

This approach leverages wildcard queries (e.g. prefix_*) and excluding indexes (e.g. -an_index).

What did you learn today?

Write a quick TIL post to reflect on what you've learned.

Write a post