Elasticsearch Reindex



Elasticsearch Reindex

Opster Team

July 2020, Version: 1.7-8.0


Before you begin reading the explanation below, try running the free ES Health Check-Up get actionable recommendations that can improve Elasticsearch performance and prevent serious incidents. Just 2 minutes to complete and you can check your threadpools, memory, snapshots and many more

Elasticsearch Reindex

What it is

Reindex is the concept of copying existing data from a source index to a destination index which can be inside the same or a different cluster. Elasticsearch has a dedicated endpoint _reindex for this purpose. A reindexing is mostly required for updating mapping or settings.

Examples

Reindex data from a source index to destination index in the same cluster

POST /_reindex?pretty
{
  "source": {
    "index": "news"
  },
  "dest": {
    "index": "news_v2"
  }
}

Notes
  • Reindex API does not copy settings and mappings from the source index to the destination index. You need to create the destination index with the desired settings and mappings before you begin the reindexing process.
  • The API exposes an extensive list of configuration options to fetch data from the source index. For example, query-based indexing and selecting multiple indices as the source index.
  • In some scenarios reindex API is not useful, where reindexing requires complex data processing and data modification based on application logic. In this case, you can write your custom script using Elasticsearch scroll API to fetch the data from source index and bulk API to index data into destination index.

Related log errors to this ES concept


Giving up on search because it failed with a non-retryable exception
Failed to clear scroll
Failed to shutdown the remote connection
Failed to properly stop client thread
Giving up on search because it failed with a non-retryable exception
Failed to clear scroll

About Opster

Opster detects, prevents, optimizes and automates everything needed to run mission-critical Elasticsearch

Find Configuration Errors

Analyze Now