# Need to update Elastic documents by a key

**URL:** <https://discuss.elastic.co/t/need-to-update-elastic-documents-by-a-key/333881>\
**Category:** Elastic Search\
**Tags:** elastic-app-search\
**Created:** [May 19, 2023, 6:17pm UTC](https://discuss.elastic.co/t/need-to-update-elastic-documents-by-a-key/333881 "2023-05-19T18:17:28Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ace540i](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ace540i/32/121212_2.png) [@ace540i](https://discuss.elastic.co/u/ace540i)\
**Post date:** [May 19, 2023, 6:17pm UTC](https://discuss.elastic.co/t/need-to-update-elastic-documents-by-a-key/333881/1 "2023-05-19T18:17:29Z")

</div>

How do you update a single field in elastic documents using a query or condition?

---

<div class="post-metadata">

**Author:** ![Sean\_Story](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sean_story/32/69987_2.png) [@Sean\_Story](https://discuss.elastic.co/u/Sean_Story)\
**Post date:** [May 19, 2023, 9:02pm UTC](https://discuss.elastic.co/t/need-to-update-elastic-documents-by-a-key/333881/2 "2023-05-19T21:02:56Z")

</div>

Hi @ace540i,

It’s not super clear to me what you’re wanting to do, so providing more details or context on your problem might help. For example, are you using an Elasticsearch Index or App Search Engine?

If you’re using the Elasticsearch API, have you seen [update-by-query](https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-update-by-query.html)?

---

<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:** [June 16, 2023, 9:03pm UTC](https://discuss.elastic.co/t/need-to-update-elastic-documents-by-a-key/333881/3 "2023-06-16T21:03:32Z")

</div>

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