# upsert operation and refresh set to 3s

**URL:** <https://discuss.elastic.co/t/upsert-operation-and-refresh-set-to-3s/362526>\
**Category:** Elasticsearch\
**Created:** [July 4, 2024, 8:20am UTC](https://discuss.elastic.co/t/upsert-operation-and-refresh-set-to-3s/362526 "2024-07-04T08:20:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![blqck](https://avatars.discourse-cdn.com/v4/letter/b/e56c9b/32.png) [@blqck](https://discuss.elastic.co/u/blqck)\
**Post date:** [July 4, 2024, 8:20am UTC](https://discuss.elastic.co/t/upsert-operation-and-refresh-set-to-3s/362526/1 "2024-07-04T08:20:49Z")

</div>

i'm doing upsert like this

```auto
public async Task AddOrUpdate(Car car, CancellationToken cancellationToken)
{
await _client.IndexAsync(user, i => i
.Index(latestIndexName)
.Id(car.Id),
cancellationToken);
}

```

and i set refresh interval to be 3s , and i DisableIdInference  
now any event that came before the refresh is done for the same car id will create a duplicate of it instead of update  
**Steps to reproduce** :  
1.set refresh to 3s  
2.disableIdinference  
3.call this method for the same car multiple times within 3s interval

**Expected behavior**  
A clear and concise description of what you expected to happen.  
i'm not sure how this should be handled , setting refresh manually just after indexasync will make the service more slow.
