# Indexing query - Bulk call

**URL:** <https://discuss.elastic.co/t/indexing-query-bulk-call/96541>\
**Category:** Elasticsearch\
**Created:** [August 10, 2017, 3:01am UTC](https://discuss.elastic.co/t/indexing-query-bulk-call/96541 "2017-08-10T03:01:45Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jsbonline2007](https://avatars.discourse-cdn.com/v4/letter/j/7cd45c/32.png) [@jsbonline2007](https://discuss.elastic.co/u/jsbonline2007)\
**Post date:** [August 10, 2017, 3:01am UTC](https://discuss.elastic.co/t/indexing-query-bulk-call/96541/1 "2017-08-10T03:01:45Z")

</div>

Hi Team,

We have base database where the Candidate records are created/update/deleted. In elasticsearch we are using es generated ID. However database do not know the ES ID generated for the record. In a batch process we are fetching the 500 records from DB and sending them to ES but we do not know which records needs to insert and which record needs to update. Also we do not know the ES ID of already updated records.

Using CURL request in BULK is there any way we can first check whether the record is present or not using unique email address of each record. If it is present then send Update request or if it is not present then send Insert request.

Is there any way we can write the script inside the BULK call?

Regards,  
Jayesh Bhoyar

---

<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:** [September 7, 2017, 3:01am UTC](https://discuss.elastic.co/t/indexing-query-bulk-call/96541/2 "2017-09-07T03:01:47Z")

</div>

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