# Updating records or check if exist and not write

**URL:** <https://discuss.elastic.co/t/updating-records-or-check-if-exist-and-not-write/382201>\
**Category:** Elasticsearch\
**Created:** [September 24, 2025, 8:32pm UTC](https://discuss.elastic.co/t/updating-records-or-check-if-exist-and-not-write/382201 "2025-09-24T20:32:51Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![elasticforme](https://avatars.discourse-cdn.com/v4/letter/e/f05b48/32.png) [@elasticforme](https://discuss.elastic.co/u/elasticforme)\
**Post date:** [September 24, 2025, 8:32pm UTC](https://discuss.elastic.co/t/updating-records-or-check-if-exist-and-not-write/382201/1 "2025-09-24T20:32:51Z")

</div>

I have case where I am trying to do following.

job#:123, status:running, user:elastic → goes to job\_index

in index \_id = job#

case1:

check if \_id:123 exist and status=running in job\_index and if is then don’t do anything else create new record.

Case2: source = job#123, status:success, user:elastic

check if \_id=123 and status=running , if yes, update record ( after this case, job:123 will never get it back from database)

I am going to use python to insert this to elastic index.

reason I am trying do this as I know create will first delete record and then insert it which is load on elastic cluster. but then query for hundreds of job from elastic is also load on cluster.

which one is better, update or search and do selective insert.?
