Same Mapping Retained After Reindexing in Elasticsearch

25 views Asked by At

I recently attempted to update the mapping of an Elasticsearch index by creating a new index with a specific mapping and then reindexing the data from the old index into the new one. However, despite creating the new index with an explicit mapping, the mapping in the new index remains the same as the old one.

Here are the steps I followed:

1-Created a new index with a specific mapping using the following command:

PUT /index 2
{
  "mappings": {
    "properties": {
      "@timestamp": {
        "type": "date",
        "format": "yyyy-MM-dd'T'HH:mm:ss.SSSSSSSSS'Z'"
      },
    }
  }
}

2-Reindexed data from the old index to the new one using the _reindex API:

POST _reindex
{
"source": {
"index": "index1"
},
"dest": {
"index": "index2"
 }
}

Despite expecting the new index to have the updated mapping, it seems to retain the same mapping as the old index. I've ensured that the mapping I specified during the creation of the new index is correct.

Is there something I might be missing or an additional step required to ensure the updated mapping is applied after reindexing?

0

There are 0 answers