# Best way to tag a large amount of documents

**URL:** <https://discuss.elastic.co/t/best-way-to-tag-a-large-amount-of-documents/252211>\
**Category:** Elasticsearch\
**Created:** [October 15, 2020, 2:09pm UTC](https://discuss.elastic.co/t/best-way-to-tag-a-large-amount-of-documents/252211 "2020-10-15T14:09:11Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![LurenzZ](https://avatars.discourse-cdn.com/v4/letter/l/41988e/32.png) [@LurenzZ](https://discuss.elastic.co/u/LurenzZ)\
**Post date:** [October 15, 2020, 2:09pm UTC](https://discuss.elastic.co/t/best-way-to-tag-a-large-amount-of-documents/252211/1 "2020-10-15T14:09:11Z")

</div>

Hi all,

This is my first question topic 🙂

Me and my colleagues are trying to figure out the best way to manage tags on a bunch of documents.  
Our scenario is, many several devices that send data to elastic, the users could set different tags on the device through a web application in order to organize the work.

We would avoid to update hundred of thousand of documents every time a user adds or removes a tag, we are thinking to create a single parent document (per device) which contains the variables data, like tags, and links it to device's documents with a "join" field datatype during the indexing process.

This would allow to update a single document per device every time that a change happen.

Could be a good solution? Any suggestion or tip would be great!

Thanks

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [October 15, 2020, 3:41pm UTC](https://discuss.elastic.co/t/best-way-to-tag-a-large-amount-of-documents/252211/2 "2020-10-15T15:41:42Z")

</div>

Updating some thousand of documents might be worth doing as using the join datatype has some drawbacks like memory usage.

So if the maximum update time is still reasonable, I'd go to the update way. Otherwise I'd use the join datatype.

---

<div class="post-metadata">

**Author:** ![LurenzZ](https://avatars.discourse-cdn.com/v4/letter/l/41988e/32.png) [@LurenzZ](https://discuss.elastic.co/u/LurenzZ)\
**Post date:** [October 15, 2020, 4:21pm UTC](https://discuss.elastic.co/t/best-way-to-tag-a-large-amount-of-documents/252211/3 "2020-10-15T16:21:59Z")

</div>

Thank for the reply,

after some research i found another possible drawback of join, the parent and child must belong to the same shard so if i rollover my index with an ilm policy I'll have to create again the parent document, right?

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [October 16, 2020, 12:36pm UTC](https://discuss.elastic.co/t/best-way-to-tag-a-large-amount-of-documents/252211/4 "2020-10-16T12:36:24Z")

</div>

I never thought about this but I believe you're right.

---

<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 13, 2020, 12:36pm UTC](https://discuss.elastic.co/t/best-way-to-tag-a-large-amount-of-documents/252211/5 "2020-11-13T12:36:25Z")

</div>

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