# Is there any way to update documents using the ingest pipeline?

**URL:** <https://discuss.elastic.co/t/is-there-any-way-to-update-documents-using-the-ingest-pipeline/381466>\
**Category:** Elasticsearch\
**Tags:** language-clients\
**Created:** [August 31, 2025, 12:17pm UTC](https://discuss.elastic.co/t/is-there-any-way-to-update-documents-using-the-ingest-pipeline/381466 "2025-08-31T12:17:43Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![xef](https://avatars.discourse-cdn.com/v4/letter/x/898d66/32.png) [@xef](https://discuss.elastic.co/u/xef)\
**Post date:** [August 31, 2025, 12:17pm UTC](https://discuss.elastic.co/t/is-there-any-way-to-update-documents-using-the-ingest-pipeline/381466/1 "2025-08-31T12:17:43Z")

</div>

We are using NEST and using the Ingest Pipeline when indexing a new document as follows:

`await ElasticSearchConfig.GetClient().IndexAsync(o, idx => idx.Index($"{index}-{user.Country.ToLower()}").Pipeline("agent-pipeline"));`

But we cannot find a way of using the Pipline when updating a document such as:

```auto
await ElasticSearchConfig.GetClient().UpdateAsync<object>(user.Id, u => u

```

`.Index($"{index}-{user.ToLower()}")`  
`.Doc(o)`  
`.Refresh(Elasticsearch.Net.Refresh.True)`  
`);`

Also, does one need to delete the Pipeline when finished?

Would appreciate any assistance.

---

<div class="post-metadata">

**Author:** ![flobernd](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/flobernd/32/124877_2.png) [@flobernd](https://discuss.elastic.co/u/flobernd)\
**Post date:** [September 1, 2025, 9:16am UTC](https://discuss.elastic.co/t/is-there-any-way-to-update-documents-using-the-ingest-pipeline/381466/2 "2025-09-01T09:16:36Z")

</div>

Hi @xef,

as far as I can tell, the `pipeline` parameter is only supported for `index`, `reindex` and `update_by_query`, but not for regular `update` ([documentation](https://www.elastic.co/docs/manage-data/ingest/transform-enrich/ingest-pipelines#add-pipeline-to-indexing-request)).

Since you seem to pass the whole document to your update call anyways, you could replace that with a second `IndexAsync` call which will have the same effect.

> Also, does one need to delete the Pipeline when finished?

This depends on your use-case. I would say in most cases you want the pipeline to persist.

> We are using NEST

I would highly recommend updating to the new client `Elastic.Clients.Elasticsearch` since NEST will be end of life at the end of this year.

---

<div class="post-metadata">

**Author:** ![xef](https://avatars.discourse-cdn.com/v4/letter/x/898d66/32.png) [@xef](https://discuss.elastic.co/u/xef)\
**Post date:** [September 3, 2025, 11:31pm UTC](https://discuss.elastic.co/t/is-there-any-way-to-update-documents-using-the-ingest-pipeline/381466/3 "2025-09-03T23:31:59Z")

</div>

Thank you so much for your time.
