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 /my-index/_mapping
PUT /my-index-aux/
PUT /my-index-aux/_mapping
{
"properties": {
"_id": {
"type": "keyword"
},
"created_at": {
"type": "date"
},
"deleted": {
"type": "boolean"
},
"user_id": {
"type": "keyword"
}
}
}GET /my-index-aux/_mapping
POST _reindex
{
"source": {
"index": "my-index"
},
"dest": {
"index": "my-index-aux"
}
}GET /my-index/_count
GET /my-index-aux/_count
DELETE /my-index
PUT /my-index
PUT /my-index/_mapping
{
"properties": {
"_id": {
"type": "keyword"
},
"created_at": {
"type": "date"
},
"deleted": {
"type": "boolean"
},
"user_id": {
"type": "keyword"
}
}
}GET /my-index/_mapping
POST _reindex
{
"source": {
"index": "my-index-aux"
},
"dest": {
"index": "my-index"
}
}GET /my-index/_count
DELETE /my-index-aux