Elasticsearch OpenSearch Reindex

By Opster Team

Updated: Mar 28, 2023

| 1 min read

In addition to reading this guide, we recommend you run the Elasticsearch Health Check-Up. It will detect issues and improve your Elasticsearch performance by analyzing your shard sizes, threadpools, memory, snapshots, disk watermarks and more.

The Elasticsearch Check-Up is free and requires no installation.

Before you begin reading this guide, we recommend you try AutoOps for OpenSearch. It will evaluate your use of OpenSearch reindex and help you resolve related log errors to this concept.

To manage all aspects of your OpenSearch operation, you can use Opster’s Management Console (OMC). The OMC makes it easy to orchestrate and manage OpenSearch in any environment. Using the OMC you can deploy multiple clusters, configure node roles, scale cluster resources, manage certificates and more – all from a single interface, for free.

Overview

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. OpenSearch 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, such as 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 OpenSearch scroll API to fetch the data from source index and bulk API to index data into destination index.

How helpful was this guide?

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?


Analyze your cluster & get personalized recommendations

Skip to content