How do I manage schema/mapping migrations/evolutions in Elasticsearch?

后端 未结 2 1903
小蘑菇
小蘑菇 2021-02-12 11:45

Flyway is a very convenient schema migration/evolution tool in the RDBMS world. I\'m looking for something similar for ES.

Even though ES is different from RDBMS and I g

相关标签:
2条回答
  • 2021-02-12 12:31

    In 2020, there seems to be an easier approach: The reindex API. You only need to do

    POST _reindex
    {
      "source": {
        "index": "my-index-000001"
      },
      "dest": {
        "index": "my-new-index-000001"
      }
    }
    

    and the data gets re-indexed.

    I am new to Elasticsearch so don't hesitate to point out where I can improve :)

    0 讨论(0)
  • 2021-02-12 12:33

    For create-new-index-then-load-data-into-it-then-update-alias, what we do is:

    1. We use templates for the mapping
    2. And we use curator to create/update the index/alias automatically.

    Still the curator has to be run periodically, but we run it in a cron job.

    0 讨论(0)
提交回复
热议问题