# Copy multiple document

**URL:** <https://discuss.elastic.co/t/copy-multiple-document/317763>\
**Category:** Elasticsearch\
**Tags:** language-clients\
**Created:** [October 30, 2022, 4:18pm UTC](https://discuss.elastic.co/t/copy-multiple-document/317763 "2022-10-30T16:18:21Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![moranmono](https://avatars.discourse-cdn.com/v4/letter/m/839c29/32.png) [@moranmono](https://discuss.elastic.co/u/moranmono)\
**Post date:** [October 30, 2022, 4:18pm UTC](https://discuss.elastic.co/t/copy-multiple-document/317763/1 "2022-10-30T16:18:21Z")

</div>

Hi  
I am using nest client with my application, I am trying to find a way to create a copy of multiple documents and change their properties. So far I have only got to this solution - [Bulk api](https://www.elastic.co/guide/en/elasticsearch/client/net-api/7.17/indexing-documents.html#_advanced_bulk_indexing), but this solution requires me to get all the documents to my client and only then update them, which will take a lot of time and memory since I need to update more than 20,000 records at a time.

Is there a way to perform all the work on the elastic server instead of getting all the documents and sending them back?

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [October 31, 2022, 1:58am UTC](https://discuss.elastic.co/t/copy-multiple-document/317763/2 "2022-10-31T01:58:39Z")

</div>

Welcome to our community! 😃

Why are you copying the documents and not updating them?  
What sort of updates are you doing?

---

<div class="post-metadata">

**Author:** ![moranmono](https://avatars.discourse-cdn.com/v4/letter/m/839c29/32.png) [@moranmono](https://discuss.elastic.co/u/moranmono)\
**Post date:** [October 31, 2022, 7:55am UTC](https://discuss.elastic.co/t/copy-multiple-document/317763/3 "2022-10-31T07:55:55Z")

</div>

This is my document

```json
"_source": {
      "category_id": 10000137,
      "aspect_id": 1000119,
      "cms_id": "custom_stores-1490011980432-96306-94",
      "aspect_name": "Packaging",
      "aspect_uuid": "772b6513-c3cf-11e9-b164-c3925ec7a797",
      "category_name": "General",
      "category_uuid": "28413970-c3de-11e9-a2bc-95a493b58504",
      "cms_line": "<cms_hl1>Like</cms_hl1> it is wrapped in the luxury all of us deserve.<revuze_cms_hidden_context>rid=203697490</revuze_cms_hidden_context>",
      "insert_date": 1647043200000,
      "not_aspect": true,
      "quote": "Like it is wrapped in the luxury all of us deserve.",
      "review_id": "203697490",
    }

```

I have multiple documents that I want to relate to aspect\_id. Sure I can change the aspect\_id field to an array and have multiple entries, but this will make it difficult for me to filter the results later.  
That is why I prefer to create a copy with different property values.

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [October 31, 2022, 11:48pm UTC](https://discuss.elastic.co/t/copy-multiple-document/317763/4 "2022-10-31T23:48:22Z")

</div>

> [@moranmono](#):
>
> `insert_date`

It looks like this is potentially time based data?  
If there is a timestamp attached to each of these documents, then I would treat it like other time based data and just add each document as an event stream. That means you could easily create the document in your app rather than having to collect it from Elasticsearch.

---

<div class="post-metadata">

**Author:** ![moranmono](https://avatars.discourse-cdn.com/v4/letter/m/839c29/32.png) [@moranmono](https://discuss.elastic.co/u/moranmono)\
**Post date:** [November 1, 2022, 5:53am UTC](https://discuss.elastic.co/t/copy-multiple-document/317763/5 "2022-11-01T05:53:52Z")

</div>

Hi, I can't create it in my app because the data is being inserted into elastic from a different source.

---

<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:** [November 29, 2022, 5:54am UTC](https://discuss.elastic.co/t/copy-multiple-document/317763/6 "2022-11-29T05:54:18Z")

</div>

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