# Reindexing with a script including hashing

**URL:** <https://discuss.elastic.co/t/reindexing-with-a-script-including-hashing/329937>\
**Category:** Elasticsearch\
**Tags:** painless, reindex\
**Created:** [April 13, 2023, 2:30pm UTC](https://discuss.elastic.co/t/reindexing-with-a-script-including-hashing/329937 "2023-04-13T14:30:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![hannesulrich](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hannesulrich/32/119798_2.png) [@hannesulrich](https://discuss.elastic.co/u/hannesulrich)\
**Post date:** [April 13, 2023, 2:30pm UTC](https://discuss.elastic.co/t/reindexing-with-a-script-including-hashing/329937/1 "2023-04-13T14:30:50Z")

</div>

Hey,  
we are currently looking into reindexing our indices and adding a new field which is the hash fingerprint of a larger field. Our approach is to pass the script to the reindexing api, but it won't work.

Our request:

```auto
{
  "source": {
    "index": "source"
  },
  "dest": {
    "index": "destination"
  },
  "script": {
    "lang": "painless",
    "source": "ctx._source['hashfield'] = ctx._source['data'].sha256()"
  }
}

```

But we are facing the following error: `dynamic method [java.lang.String, sha256/0] not found`, but according to that [PR](https://github.com/elastic/elasticsearch/pull/59671) - this should be working? Any ideas how to tackle this?

Best, Hannes

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [May 11, 2023, 2:31pm UTC](https://discuss.elastic.co/t/reindexing-with-a-script-including-hashing/329937/2 "2023-05-11T14:31:10Z")

</div>

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