# How to wait for indexing to finish before closing bulkingester

**URL:** <https://discuss.elastic.co/t/how-to-wait-for-indexing-to-finish-before-closing-bulkingester/339875>\
**Category:** Elasticsearch\
**Created:** [August 2, 2023, 2:23am UTC](https://discuss.elastic.co/t/how-to-wait-for-indexing-to-finish-before-closing-bulkingester/339875 "2023-08-02T02:23:21Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ALX\_DM](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/alx_dm/32/106314_2.png) [@ALX\_DM](https://discuss.elastic.co/u/ALX_DM)\
**Post date:** [August 2, 2023, 2:23am UTC](https://discuss.elastic.co/t/how-to-wait-for-indexing-to-finish-before-closing-bulkingester/339875/1 "2023-08-02T02:23:21Z")

</div>

how to wait for indexing to finish before closing bulkingester.

previously we have awaitClose() for bulkprocessor. is is same for bulkingester?  
there is no awaitClose, but there is wait() in bulkIngester.  
I am not sure if this is the right function to use.  
I find no document on this on elasticsearch website.

please give example.

thank you.

---

<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:** [August 2, 2023, 8:15am UTC](https://discuss.elastic.co/t/how-to-wait-for-indexing-to-finish-before-closing-bulkingester/339875/2 "2023-08-02T08:15:08Z")

</div>

But you can call close().

---

<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:** [August 30, 2023, 8:15am UTC](https://discuss.elastic.co/t/how-to-wait-for-indexing-to-finish-before-closing-bulkingester/339875/3 "2023-08-30T08:15:55Z")

</div>

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