# Multiple \_id for same document or document alias

**URL:** <https://discuss.elastic.co/t/multiple-id-for-same-document-or-document-alias/307296>\
**Category:** Elasticsearch\
**Created:** [June 15, 2022, 3:19pm UTC](https://discuss.elastic.co/t/multiple-id-for-same-document-or-document-alias/307296 "2022-06-15T15:19:00Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![nerd2000](https://avatars.discourse-cdn.com/v4/letter/n/f19dbf/32.png) [@nerd2000](https://discuss.elastic.co/u/nerd2000)\
**Post date:** [June 15, 2022, 3:19pm UTC](https://discuss.elastic.co/t/multiple-id-for-same-document-or-document-alias/307296/1 "2022-06-15T15:19:00Z")

</div>

Is it possible to have multiple ids for the same document or have a alias to a document?  
Already found this [topic](https://discuss.elastic.co/t/multiple-ids-for-the-same-document/5507) but a long time ago, checking if it was implemented meanwhile.  
The use case:  
I have a sql database with multiple tables with unique ids but referencing one global table which has the metadata. I would like to import the id from the global table and its metadata, but also import the metadata from the other tables. Instead of importing the same data multiple times because it's the same source, would it be possible to reference the document with the metadata?  
Also, I'm getting by document \_id and not by a search query, that's why I was looking for multiple document \_id or document alias maybe.

---

<div class="post-metadata">

**Author:** ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)\
**Post date:** [June 15, 2022, 3:48pm UTC](https://discuss.elastic.co/t/multiple-id-for-same-document-or-document-alias/307296/2 "2022-06-15T15:48:49Z")

</div>

You can have multiple fields with those ids, but you would need to find those documents using a search query, not by the `_id`.

You can have only one `_id` per document.

---

<div class="post-metadata">

**Author:** ![nerd2000](https://avatars.discourse-cdn.com/v4/letter/n/f19dbf/32.png) [@nerd2000](https://discuss.elastic.co/u/nerd2000)\
**Post date:** [June 16, 2022, 7:00am UTC](https://discuss.elastic.co/t/multiple-id-for-same-document-or-document-alias/307296/3 "2022-06-16T07:00:23Z")

</div>

Alright, got it, thank you.

---

<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:** [July 14, 2022, 7:00am UTC](https://discuss.elastic.co/t/multiple-id-for-same-document-or-document-alias/307296/4 "2022-07-14T07:00:38Z")

</div>

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