Note: Before using this feature, you must have the merge mode enabled for crawling in your index. Please contact AddSearch support to enable this functionality, as without it, the next crawler update will overwrite any API-modified data.
This article explains how you can index your website with AddSearch crawler and use Indexing API to enrich crawled documents with additional data.
By default, updating a document with crawler or API overwrites all existing fields with new values. It also empties the fields for which no value has been provided. The merge mode allows updating specified fields without affecting others.
Merge mode is a setting that controls how updates of a document are handled. You can use it in two ways: per individual API request, or site-wide for all crawler operations. To enable merge mode for crawling, please contact the AddSearch support team at support@addsearch.com. This will ensure that crawlers do not erase custom fields that were added via Indexing API.
When updating documents with API, you can control how the new data merges with existing document data using the standard_fields_update_mode and custom_fields_update_mode query parameters.
Each parameter accepts two values:
To update only specific custom fields while preserving existing standard fields:
PUT /v2/indices/{index public key}/documents/{document id}?standard_fields_update_mode=merge&custom_fields_update_mode=merge { "custom_fields": { "price": 99, "currency": "USD" } }
For more information, please visit our API guidelines.
We’re always happy to help with code or other questions you might have. Search our documentation, contact support, or connect with our sales team.