Reindexing from non-nested to nested


(Rishi Upadhyay) #1

I created an elastic document with dynamic mapping. As by default elastic does not take the json array as nested but i wanted the mapping to be nested.
As a solution i had to create a new index with mapping changes to nested and reindex all the data.

I did that but while trying to reindex data elastic is giving illegal argument exception. ( object mapping [performedActions] can't be changed from nested to non-nested)

My Earlier Index -    `"performedActions" : {
            "properties" : {
              "actionTs" : {
                "type" : "text",
                "fields" : {
                  "keyword" : {
                    "type" : "keyword",
                    "ignore_above" : 256
                  }
                }
              },`

New One - "performedActions" : { "type" : "nested", "properties" : { "actionTs" : { "type" : "text", "fields" : { "keyword" : { "type" : "keyword", "ignore_above" : 256 } }

Reindex CURL

         curl -XPOST 'localhost:9200/_reindex?pretty' -H 'Content-Type: application/json' -d'
    {
      "source": {
        "index": "pendingonme"
      },
      "dest": {
        "index": "action"
      }
    }

(system) #2

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