title: Re-name the field names in elasticsearch
body: <p>I am trying to rename the filed names in elastic search and below is sample data, in which i need to change some/all the field names and also nested objects</p>
  
  <pre><code>{   
     "took": 63,  
     "timed_out": false,  
     "_shards": {  
        "total": 5,  
        "successful": 5,  
        "failed": 0  
     },  
     "hits": {  
        "total": 1000,  
        "max_score": 1,  
        "hits": [  
           {  
              "_index": "course",  
              "_type": "product",  
              "_id": "14",  
              "_score": 1,  
              "_source": {  
                 "quantity": 25,  
                 "price": "137.62",  
                 "name": "Veal - Leg",  
                 "description": "Morbi non lectus. Aliquam sit amet diam in magna bibendum imperdiet. Nullam orci pede, venenatis non, sodales sed, tincidunt eu, felis. Fusce posuere felis sed lacus. Morbi sem mauris, laoreet ut, rhoncus aliquet, pulvinar sed, nisl. Nunc rhoncus dui vel sem.",  
                 "categories": [  
                    {   
                       "name": "Sport"  
                    },  
                    {  
                       "name": "Clothing"  
                    }  
                 ],  
                 "tagNames": [  
                    "phones",  
                    "elasticsearch"  
                 ],  
                 "status": "inactive" 
              }  
           }
  }        
  </code></pre>
  
  <p>Now i want to rename all the above existing field with new field names  I tried this solution    </p>
  
  <pre><code>  POST /_reindex  
  {  
       "source": {  
      "index": "course"  
  },  
  "dest": {  
      "index": "course_new"  
    },  
   "script": {  
      "inline": "ctx._source.tags = ctx._source.remove(\"tagNames\")"  
  
    }  }   
  </code></pre>
  
  <p>but this solution will rename/modify one field only(not even nested fields), how can i rename multiple/all above mentioned fields in elastic search index.</p>
  
  <p>Thanks for your fast response and appreciate your fast response</p>