# Copy single field from one index to another existing index

**URL:** <https://discuss.elastic.co/t/copy-single-field-from-one-index-to-another-existing-index/232794>\
**Category:** Elasticsearch\
**Created:** [May 15, 2020, 10:39am UTC](https://discuss.elastic.co/t/copy-single-field-from-one-index-to-another-existing-index/232794 "2020-05-15T10:39:47Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![thekozak](https://avatars.discourse-cdn.com/v4/letter/t/dec6dc/32.png) [@thekozak](https://discuss.elastic.co/u/thekozak)\
**Post date:** [May 15, 2020, 10:39am UTC](https://discuss.elastic.co/t/copy-single-field-from-one-index-to-another-existing-index/232794/1 "2020-05-15T10:39:48Z")

</div>

Is it possible to take a field from one index and copy it to another existing index without loosing fields it already contains?

For example I have an index `abc` having fields `field_a`, `field_b`, `field_c` and index `def` having fields `field_d`, `field_e`, `field_f`. What I want to achieve is to have index `def` having fields: `field_d`, `field_e`, `field_f` (already existing in `def`) and `field_a` (taken from `abc`). Both indices are identified by the same `_id` but documents have different types.

I was trying to use \_reindex API:

```auto
    POST _reindex
    {
        "source": {
            "index": "abc",
            "_source": [
                "field_a"
            ],
            "query": {"match_all": {}}
        },
        "dest": {
            "index": "def"
        }
    }

```

but it replaces currently existing documents in `def` instead of just adding a field.

Currently, I'm using Elasticsearch 5.6.

---

<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:** [June 12, 2020, 10:39am UTC](https://discuss.elastic.co/t/copy-single-field-from-one-index-to-another-existing-index/232794/2 "2020-06-12T10:39:51Z")

</div>

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