# Convert the long datatype field to string

**URL:** <https://discuss.elastic.co/t/convert-the-long-datatype-field-to-string/131692>\
**Category:** Elasticsearch\
**Created:** [May 14, 2018, 8:39am UTC](https://discuss.elastic.co/t/convert-the-long-datatype-field-to-string/131692 "2018-05-14T08:39:08Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![rajesnal](https://avatars.discourse-cdn.com/v4/letter/r/df788c/32.png) [@rajesnal](https://discuss.elastic.co/u/rajesnal)\
**Post date:** [May 28, 2018, 1:25pm UTC](https://discuss.elastic.co/t/convert-the-long-datatype-field-to-string/131692/5 "2018-05-28T13:25:42Z")

</div>

Finally, I got the solution. Thank you very much for your support.

Below is the same.

```
POST _reindex?pretty
{
  "source": {
    "index": "index1.1526279922.1"
  },
  "dest": {
    "index": "index1.string.1"
  },
  "script": {
    "source": "ctx._source.inode = '' + ctx._source.inode"
  }
}
```

---

_[View the full topic](https://discuss.elastic.co/t/convert-the-long-datatype-field-to-string/131692)._
