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
safeparameter to ensure that these (asynchronous) operations are performed in sequence. - If there’s an error during 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):
copySettingsandmoveIndex. -
The API key you use for this operation must have access to the index
YourIndexand 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.