Reindex API between 2.4 and 6.4

Hi,
Is re-indexing possible between 2.4 and 6.4 ?
I am getting the following error:

    Rejecting mapping update to [track_201801] as the final mapping would have more than 1 t
    ype: [_doc, position]"},"status":400}]}

I have created a index template on 6.4 like this :

    "mappings": {
        "_doc": {
          "properties": {
            "loc": {
              "tree": "quadtree",
              "type": "geo_shape"
            },
            ......

So i have the type _doc

The problem is that on 2.4 my document has a type position which IMO causes this error .

How can I address this problem ?

You should be able to use reindex Api with an ingest pipeline and set/change the type there.

Thank you!
This solves it.
In case anyone wants and example

curl  -H 'Content-Type: application/json' -XPOST  new.server:9200/_reindex -d'
{
  "source": {
    "remote": {
      "host": "http://old.server:9200"
    },
    "index": "index_201801"
  },
  "dest": {
    "index": "index_201801"
  },
  "script": {
    "lang": "painless",
    "inline": "ctx._type = params.doc",
    "params":{
      "doc":"_doc"
    }
  }
}'

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