---
title: "Partially updating a document"
slug: "partially-updating-a-document"
abstract: "Describes how to use the Ingestion API for Sitecore Search to partially update an index document."
---
# Partially updating a document

Use the `PATCH` method on the base URL of the Ingestion API to update one or more attribute values in an index document.

> [!important]
> When an administrator recrawls a pull source, either [manually](https://doc.sitecore.com/search/en/users/search-user-guide/en/manually-trigger-a-recrawl-or-reindex.html) or through [scheduled crawls](https://doc.sitecore.com/search/en/users/search-user-guide/en/configure-a-crawler-schedule.html), Search updates all index documents with the latest data from your original content. This action overwrites any updates you made through the Ingestion API if they aren't also applied to the original content. To prevent this, we recommend that you always update the original content with changes made through the Ingestion API. This synchronization ensures that your modifications are maintained in future crawls.

To use the Ingestion API to partially update a document, make a `PATCH` call to the [Partial Update Document](https://doc.sitecore.com/search/en/developers/search-developer-guide/using-the-ingestion-api-to-add-content-to-an-index/using-the-ingestion-api-to-add-content-to-an-index.html#UUID-1c8015c3-4068-9441-f0bd-bdea5b1d7821_section-idm1823354355957710 "Using the Ingestion API") endpoint.

For the data model of this method and a description of objects and keys, see the [Ingestion API reference](https://doc.sitecore.com/search/en/developers/ingestion-api/index.html). You can [view your base URL](https://doc.sitecore.com/search/en/developers/search-developer-guide/the-sitecore-search-interface/the-api-access-tab.html "The API Access tab") in the **Developer Resources** section of Search.

> [!note]
> The `PUT` (update) and `PATCH` (partially update) methods differ. Use `PUT` (update) when you want Sitecore Search to replace all fields with the values you pass and delete fields you do not pass. Use `PATCH` when you want Search to replace the fields you pass and leave other fields as-is.
>
> For example, an index document exists with the *title*, *description*, and *image\_URL* fields. If you pass a *PUT* call with only the *title* and *description* fields, Search assumes that you want to do two things - update the *title* and *description* fields and delete the *image\_URL* field. If you pass a `PATCH` call with only the *title* and *description* fields, Search updates these fields and does not modify any other field.

You can partially update or delete documents in one, some, or all locales. To update or delete documents in more than one locale, in the request URL, pass the locales separated by an ampersand (`&`). For example, to partially update or delete documents in the English (US) and Japanese (Japan) locales, use `locale=en_us&locale=ja_jp`. To partially update or delete all locales, pass `locale=all`.

You can partially update or delete more than one locale at a time because index documents for multiple locales share the same index document ID. This is so that users don't see duplicate results and only see content that is relevant to their locale. You configure this when you set up the crawler source or create documents with the Ingestion API.

For example, you want to update the *image_url* attribute for index documents in two locales.

Here is a sample `PATCH` cURL call:

```Shell
curl --location 'https://<base-url>/domains/<domainID>/sources/<sourceID>/entities/<entity>/documents/<documentID>?locale=<locale1>&locale=<locale2>' \
--header 'Content-Type: application/json' \
--header 'Authorization: <api-key>' \
--data '{
    "document": {
        "id": "test_id_123",
        "fields": {
        "image_url": "www.newimageURL.com"
        }
    }
}' \
-X PATCH
```

If your request is successful, you get a `200` response with this body:

```JSON
{
    "enqueued": true
}
```

In the response, *enqueued* means that Search has added this document to its indexing queue. After a few minutes, you'll see the updated index document in the **Content Collection** section of Search.