It depends on your plan, but the more important answer is that saveObjects can increase your record count, which is billed on every current plan.
Indexing operations
| Your plan | Does saveObjects count? |
|---|---|
| Released after July 2020, including Grow | No. Indexing operations aren't billed, so the indexing itself is free. |
| Legacy plans that bill indexing operations | Yes. Each record in the batch counts as one operation. |
To check which applies to you, see How do I check which plan my Algolia application is on?
The part that does cost you: accidental new records
saveObjects does two different jobs depending on the objectID you send:
-
Adds a new object, if the
objectIDdoesn't already exist. - Replaces an existing object, if it does.
So if you intend to update a record but pass a missing, changed, or auto-generated objectID, Algolia creates a second record instead of overwriting the first. Your total record count grows, and records are billed on every current plan, this is a common cause of unexplained record growth.
Always pass the exact objectID you want to update. If you only need to change some attributes, partialUpdateObjects is safer and cheaper in payload terms.