- You’ve changed your index structure.
- Your source has changed since the last update.
- Your index no longer matches your source data and you need to restore consistency.
- Two or more sources update the same and you need to resolve conflicting changes.
- Full reindexing: replace your entire index with a new set of records.
- Full record updates: replace an entire record with a new one.
- Partial record updates: update only a subset of attributes within a record.
Algolia Academy
Learn more about: Data Sync: Keeping Your Index Fresh
Choose an update frequency
How often you update depends on how often your content changes and how fast you need it to be searchable. An ecommerce store typically:- Sends price and availability updates in real time.
- Sends the number of sales, used for custom ranking, periodically in batches.
Full reindexing
A full reindex replaces all records in your index with a new dataset. Send every record you want to keep. Use full reindexing when you can’t reliably track individual changes. For example, on a documentation site, splitting long pages into records can improve search relevance. An edit can change the record structure, making individual changes difficult to track. If you can’t reliably identify changed records, consider a full reindex. To replace all records, use:- An API client: use the
replaceAllObjectsmethod. - A connector: choose Full reindexing.
- The Push to Algolia connector: configure transformation options on the search client,
then use
replaceAllObjectsWithTransformation. Check the method’s connector requirements before using it.
A full reindex sends every record, which can increase your indexing operations count
and take longer than partial updates.
How a full reindex works
replaceAllObjects doesn’t clear your index and refill it.
It builds the new index next to the old one, then swaps them:
- Copies the settings, synonyms, and rules of your index to a temporary index named
INDEX_NAME_tmp_*. - Sends your records to the temporary index in batches.
- Moves the temporary index over your index.
Before you begin a full reindex
Review the following requirements and behaviors:- Settings, synonyms, and rules come from the existing index.
If you want the new index to differ, change them before the reindex.
To copy only some of them, use the method’s
scopesparameter. - API key.
The API key needs the
addObjectpermission. If you want the Algolia API client to remove the temporary index after a failure, it also needsdeleteIndex. If you restrict the key to specific indices, also allow access to the temporary indexINDEX_NAME_tmp_*, for example by restricting the key toINDEX_NAME*instead of the exact name. - Record count. During a full reindex, Algolia temporarily holds the old and new records, which can increase your record count. Monthly billing excludes the three days with the highest record counts. Reindexing more frequently can affect your billed usage.
- Updates during reindexing. If other processes update only the original index during a full reindex, their changes don’t carry over to the temporary index. Those updates appear to succeed, but the move discards them without displaying an error. Pause those processes until the reindex finishes, or re-send their changes afterward.
- Replicas. The move keeps the index’s replicas and copies the new records to them.
After a full reindex
- If it succeeds, your index contains only the records you sent. The temporary index no longer exists.
- If it fails, your index keeps its existing records and remains searchable.
Your Algolia API client needs an API key with the
deleteIndexpermission to delete the temporary index. If the temporary index remains, find its name, which starts withINDEX_NAME_tmp_, and delete it from the Algolia dashboard or withdeleteIndex.
Full reindexing with connectors
A connector task set to Full reindexing works the same way asreplaceAllObjects.
It copies the settings, synonyms, and rules of your index to a temporary index named INDEX_NAME.RUN_ID.tmp,
sends the records there, and moves the temporary index over your index when the run completes.
Your index stays searchable with the old records until the move.
Full record updates
Use full record updates when you can identify changed records and send their complete data. Algolia removes any existing attributes you omit. For example, a forum member directory can use one record per member.- When you add or update a member, send the complete member record to Algolia.
- When you delete a member, delete the corresponding record from the index.
- An API client: use the
saveObjectsmethod. Include anobjectIDfor each record to update. Algolia replaces an existing record with the sameobjectID. - A connector: choose Full record updates.
Partial record updates
Use partial record updates to change specific attributes without sending the complete record. Consider an online store with a content management system for product descriptions and a separate review system. Each system sends partial record updates for the attributes it manages, preserving the other system’s attributes. Partial updates preserve attributes you don’t include. If an attribute disappears from your source, handle its removal from the index separately. To update individual attributes, use:- An API client: use the
partialUpdateObjectsmethod. - A connector: choose Partial record updates.
Remove records missing from your source
Full record updates and partial record updates affect only the records you send. If an item disappears from your source, its record stays in the index until you delete it or replace the whole index. Algolia doesn’t compare your index with your source. For example, suppose a documentation page splits into five records with stableobjectID values.
After an edit, the page has three sections.
If you send full record updates for the three corresponding object IDs, Algolia replaces those records.
The other two records remain in the index, and searches can still return them.
To remove records that no longer have a source item:
- Delete them explicitly.
If you can tell which items disappeared, delete their records with
deleteObjects. If you can’t get the records’ object IDs, usedeleteBywith a filter that identifies the records to remove.deleteByrequires thedeleteIndexpermission, notdeleteObject. For more information, see Delete records. - Replace the whole index. If you can’t tell which items disappeared, run a full reindex. The index then contains exactly the records you sent.
Connectors and integrations
For connectors, a task set to Full record updates or Partial record updates leaves records that disappeared from the source in the index. Choose Full reindexing if you need to remove them and don’t handle deletions separately. The ecommerce integrations handle deletions themselves:- Shopify, BigCommerce, and commercetools delete a record after the platform reports the deletion, regardless of the task’s update strategy.
- Salesforce B2C Commerce sends delete operations from its delta jobs.