Rejecting mapping update to [test] as the final mapping would have more than 1 type: [type1, doc]

Hello,

I'm following Removal of mapping types | Elasticsearch Reference [6.0] | Elastic, by creating new index with single type of document and trying to perform _reindex:

My elasticsearch has index with _type: type1 and while using _reindex, I got following error:

"failures": [
{
"index": "test",
"type": "type1",
"id": "X",
"cause": {
"type": "illegal_argument_exception",
"reason": "Rejecting mapping update to [test] as the final mapping would have more than 1 type: [type1, doc]"
},
"status": 400
},

Can Reindex API be used to change _type? painless script or logstash?
maybe someone can provide examples?

Please advise.

1 Like

Can you show the reindex request you sent?

POST _reindex
{
  "source": {
    "index": "myoldindex"
  },
  "dest": {
    "index": "test"
  }
}

How many types are in the old index?

some have up to 3, but usually just 1.

Then you would probably be better off splitting those up into different indices.

that's what i'm trying to do with _reindex, I can't figure out how to do it with painless script..

POST _reindex
{
  "source": {
    "index": "myoldindex",
    “type”: “type1”
  },
  "dest": {
    "index": "test",
    “type”: “doc”
  }
}
2 Likes

This is exactly what I was looking for) Thank you so much! @dadoonet

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.