# Bulk index documents only if they don't already exist without using an id

**URL:** <https://discuss.elastic.co/t/bulk-index-documents-only-if-they-dont-already-exist-without-using-an-id/361166>\
**Category:** Elasticsearch\
**Created:** [June 10, 2024, 2:53pm UTC](https://discuss.elastic.co/t/bulk-index-documents-only-if-they-dont-already-exist-without-using-an-id/361166 "2024-06-10T14:53:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![catalin8](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/catalin8/32/132014_2.png) [@catalin8](https://discuss.elastic.co/u/catalin8)\
**Post date:** [June 10, 2024, 2:53pm UTC](https://discuss.elastic.co/t/bulk-index-documents-only-if-they-dont-already-exist-without-using-an-id/361166/1 "2024-06-10T14:53:11Z")

</div>

I'm looking to index a list of documents using the bulk API. I want to add only the ones that are not already indexed, and I don't use IDs.

Is this possible?

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [June 10, 2024, 3:01pm UTC](https://discuss.elastic.co/t/bulk-index-documents-only-if-they-dont-already-exist-without-using-an-id/361166/2 "2024-06-10T15:01:15Z")

</div>

If you are not specifying your own IDs that is not possible.

---

<div class="post-metadata">

**Author:** ![Alex\_Salgado-Elastic](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/alex_salgado-elastic/32/103081_2.png) [@Alex\_Salgado-Elastic](https://discuss.elastic.co/u/Alex_Salgado-Elastic)\
**Post date:** [June 10, 2024, 3:14pm UTC](https://discuss.elastic.co/t/bulk-index-documents-only-if-they-dont-already-exist-without-using-an-id/361166/3 "2024-06-10T15:14:38Z")

</div>

Hi @catalin8

What comparison criterion do you use to know if your document is already indexed?
