Hi ,
I am trying to shrink the indices in elasticsearch. Currenrly i have 5 primary shards and 1 replica .
I want to change it to 1 primary and 1 replica shards.
i have executed the steps mention in Shrink Index | Elasticsearch Reference [5.5] | Elastic
But while shrinking i am getting below error. Anyone can help?
curl -XPOST -u xxxx:xxxxx 'xx.xx.xx.xx:9200/reporting-2017.08.12/_shrink/reporting-2017.08.12-reindexed?pretty' -H 'Content-Type: application/json' -d'
{
"settings": {
"index.number_of_replicas": 1,
"index.number_of_shards": 1,
"index.codec": "best_compression"
}
}
'
{
"error" : {
"root_cause" : [
{
"type" : "illegal_argument_exception",
"reason" : "mappings are not allowed when shrinking indices, all mappings are copied from the source index"
}
],
"type" : "illegal_argument_exception",
"reason" : "mappings are not allowed when shrinking indices, all mappings are copied from the source index"
},
"status" : 400
}