Skip to content

Instantly share code, notes, and snippets.

View MalekBouba's full-sized avatar
🏆
Code champ!

Malek Boubakri MalekBouba

🏆
Code champ!
View GitHub Profile
@MalekBouba
MalekBouba / elk_re-index.md
Last active August 24, 2020 10:53
Safe and clean code snippet to copies documents from one index to another using Elasticsearch Reindex API.

Reindex requires _source to be enabled for all documents in the source index. You must also set up the destination index before calling _reindex. Reindex does not copy the settings from the source index. Mappings, shard counts, replicas, and so on must be configured ahead of time.

Here is a simple example, you just need to change my-index & my-index-aux with your indexes names.

Get 'source' mapping

GET /my-index/_mapping