This page documents an earlier version of the API client. For the latest version, see Replace all records.
addObject
This method lets you replace all records in your index without downtime.
It performs these operations:
- Copy settings, synonyms, and rules from your original index to a temporary index.
- Add your new records to the temporary index.
- Replace your original index with the temporary index.
-
Use the
safe
parameter to ensure that these (asynchronous) operations are performed in sequence. - If there’s an error duing one of these steps, the temporary index won’t be deleted.
- This operation is rate-limited.
- This method creates a temporary index: your record count is temporarily doubled. Algolia doesn’t count the three days with the highest number of records towards your monthly usage.
-
If you’re on a legacy plan (before July 2020), this method counts two operations towards your usage (in addition to the number of records):
copySettings
andmoveIndex
. -
The API key you use for this operation must have access to the index
YourIndex
and the temporary indexYourIndex_tmp
.
Examples
Replace all records
Replace all records and wait for operations
Parameters
List of records.Python: Use an iterator instead of a list to prevent memory issues,
especially if you want to replace many records.
A mapping of request options to send along with the query.
If true, wait after each step before continuing.