# Elasticsearch Transforms

**URL:** https://discuss.elastic.co/t/elasticsearch-transforms/265874
**Category:** Elasticsearch
**Tags:** transforms
**Created:** [March 1, 2021, 9:28pm UTC](https://discuss.elastic.co/t/elasticsearch-transforms/265874 "2021-03-01T21:28:00Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![przemekwitek](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/przemekwitek/32/79526_2.png) [@przemekwitek](https://discuss.elastic.co/u/przemekwitek)
#### Post date: [March 2, 2021, 6:29am UTC](https://discuss.elastic.co/t/elasticsearch-transforms/265874/2 "2021-03-02T06:29:48Z")

</div>

Hi,  
It is by design that there is exactly one document corresponding to the given group-by id in the destination index. So if you use `id` field in group-by section on transform pivot config, the transform will do just this: take all the documents with the given `id` and summarize it in one document in the destination index.  
If you'd like to have 1:1 relation between documents in source and destination, you should be using an id that is unique among documents, something like "event id" or maybe even "timestamp".

If you do not need continuous updates functionality, you could also try using reindex + scripted field. There is another ticket in which this is discussed:

> [@Reindex data with a new Field](https://discuss.elastic.co/t/reindex-data-with-a-new-field/115073/2):
>
> There is an example of using reindex to modify the document in the docs [here](https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-reindex.html#docs-reindex-change-name). It changes the name of a field but you can use the same script construct to do what you want to do. I suspect the script looks something like "script": "ctx.\_source['timestamp\_hour'] = ctx.\_source['@timestamp'].getHourOfDay(). You are right that it will be much better at search time to use this new field. Watch the time zone, btw. I believe the hour that you get in this case is UTC. You could also do this with \_update…

---

_[View the full topic](https://discuss.elastic.co/t/elasticsearch-transforms/265874)._
