Changing _type field using elasticsearch RESTAPI commands

Hi!
Could anyone give some advice about it?
So i'm trying to copy doc into another _type, for right now i want to have a function at python script that changes type by reindexing doc twice ( 1-st one is changing index and _type, 2-nd is changing index back to original with new _type & then deletes the new index ) Right now i'm trying to understand how to use python lib or some REST API commands to make it real. That's what i was doing:

POST _reindex
{
  "source": {
    "index": "logstash-",
    "type": "new_type",
    "query": {
      "match": {
        "_id": "cws-prd-prox-f-04.mia2.comWARNING"
      }
    }
  },
  "dest": {
    "index": "logstash2-",
    "type": "new_type2"
  }
}

POST _reindex
{
  "source": {
    "index": "logstash2-",
    "type": "new_type2",
    "query": {
      "match": {
        "_id": "cws-prd-prox-f-04.mia2.comWARNING"
      }
    }
  },
  "dest": {
    "index": "logstash-",
    "type": "new_type2"
  }
}

DELETE /logstash2-/new_type2/cws-prd-prox-f-04.mia2.comWARNING

So basically i'm searching for some equivalent to reindex - retype or smth like that. Any ideas?
Hope not to use elasticsearch-dump .

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