# Hashing index fields using elasticsearch

**URL:** <https://discuss.elastic.co/t/hashing-index-fields-using-elasticsearch/236657>\
**Category:** Elasticsearch\
**Created:** [June 11, 2020, 9:14am UTC](https://discuss.elastic.co/t/hashing-index-fields-using-elasticsearch/236657 "2020-06-11T09:14:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![MarcoV](https://avatars.discourse-cdn.com/v4/letter/m/fbc32d/32.png) [@MarcoV](https://discuss.elastic.co/u/MarcoV)\
**Post date:** [June 11, 2020, 9:14am UTC](https://discuss.elastic.co/t/hashing-index-fields-using-elasticsearch/236657/1 "2020-06-11T09:14:05Z")

</div>

Hi all, I have a question.  
In my index I have two fields that I want merge into a third field and than I whish to hash this "new field" using elasticsearch' script processor.

For exemple:  
My index:  
field1: foo1  
field2: foo2

After running the script I would like to have a new field which is the sha1 hash of the merge of field1 and field2

field3: 89b6374dca999b98c9f787f0d7a7c98854dba7c9

It is possible to do that without reindex? Or a reindex is needed?

A simple 32 bit hashing is enough to save the performances of es, sha1 is just for explain the example

Can someone help me please?

My version of elasticsearch is 7.1.1

Thank you

---

<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:** [July 9, 2020, 9:14am UTC](https://discuss.elastic.co/t/hashing-index-fields-using-elasticsearch/236657/2 "2020-07-09T09:14:14Z")

</div>

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