Billing and partialUpdate

Hi there,

I have a simple question about the following indexing operation: partialUpdateObjects.

If no record has been updated, are we billed for the attempts?

Thank you!


Do you mean when using createIfNotExists: false? So that no object gets created when non existent?

Can you give us a more detailed example of a case where you would do a partialUpdateObjects and no objects would be updated? Thanks!


Thanks for your quick reply.

Assuming that we have an indexed record:

    "objectID": "rec1",
    "data": "row"

and we send the following request:

  data: 'row',
  objectID: 'rec1'

Is the record still be updated with data: row and we are billed for 1 indexing request? (as there is no need to update the record (no data change))

Thank you.

Hi! Even if your update will have the same effect, it still counts as an update on our side. The goal of making indexing operations paying is because those are the most resource consuming for our servers: we cannot have any cache and we need to rebuild the index afterwards.

Algolia does not do any diff on the object update to avoid counting it as an operation, it would be even more resource consuming to do diffs, especially on big objects.

If there’s no need to update the record I would advise you to build that diff algorithm on your side and to know when or when not to update your records. You can do this by having a hash for each object inside Algolia and before every update, do a getObject, check the SHA, compare it with your own data and then do or do not do an update.

Let me know what you think!