# Is is possible to partially update a dest doc with transforms?

**URL:** <https://discuss.elastic.co/t/is-is-possible-to-partially-update-a-dest-doc-with-transforms/209808>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-machine-learning\
**Created:** [November 28, 2019, 8:18am UTC](https://discuss.elastic.co/t/is-is-possible-to-partially-update-a-dest-doc-with-transforms/209808 "2019-11-28T08:18:09Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![Hendrik\_Muhs](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hendrik_muhs/32/25802_2.png) [@Hendrik\_Muhs](https://discuss.elastic.co/u/Hendrik_Muhs)\
**Post date:** [November 28, 2019, 10:13am UTC](https://discuss.elastic.co/t/is-is-possible-to-partially-update-a-dest-doc-with-transforms/209808/4 "2019-11-28T10:13:38Z")

</div>

Hi,

a transform can have multiple sources and they do not need a common schema as long as the field name of the group\_by is compatible. So if you have for example a field "customer\_id" in both indices "past\_purchases" and "predicted\_purchases" you can create a transform that joins over both indices:

```auto
PUT _transform/prediction_accuracy
{
  "source": {
    "index": ["past_purchases", "predicted_purchases"]
  },
  "pivot": {
    "group_by": {
      "id": {"terms": {
        "field": "customer_id"
      }}
    },
  "aggregations": { 
...}
}

```

Note that aggregations are robust w.r.t. to missing fields, so if you have a field in your "past\_purchases" index, but not in "predicted\_purchases" you can still aggregate on it to e.g. calculate an average (with the correct count under the hood).

I hope this helps!

---

_[View the full topic](https://discuss.elastic.co/t/is-is-possible-to-partially-update-a-dest-doc-with-transforms/209808)._
