Skip to main content
After initially uploading your data, you need to keep your up to date as the data changes*. One way of doing so is with incremental updates, by tracking changes and forwarding them to Algolia. Whenever you add, edit, or delete data from your source, update the corresponding so they reflect the latest state of your data.

Track each record with a unique identifier

To perform incremental updates, you need to declare a unique identifier for each record so you can track what data matches what record. This identifier should map to a “key” you store on your side. You need to store the unique identifier in the objectID attribute.

Add records

Whenever you add new data in your data source, you can add them to Algolia with the saveObjects method.
var response = await client.SaveObjectsAsync(
  "ALGOLIA_INDEX_NAME",
  new List<Object>
  {
    new Dictionary<string, string> { { "objectID", "1" }, { "name", "Adam" } },
    new Dictionary<string, string> { { "objectID", "2" }, { "name", "Benoit" } },
  }
);

Update records

You can update records in two ways:
  • Fully replace the old record with a new one
  • Update only a subset of the record (attributes) with new data

Replace old records

When saving a record in Algolia, if a record with the specified objectID already exists in the index, the engine replaces it. You can replace an existing record by using the saveObjects method and specifying the objectID. This technique is useful when you’re updating data in a single place in your system, or when you don’t know what changed.
var response = await client.SaveObjectsAsync(
  "ALGOLIA_INDEX_NAME",
  new List<Object>
  {
    new Dictionary<string, string> { { "objectID", "1" }, { "name", "Adam" } },
    new Dictionary<string, string> { { "objectID", "2" }, { "name", "Benoit" } },
  }
);

Update a subset of the record

When you don’t need to replace the entire record, you can also update specific attributes of a record. This is useful when you know which attribute to update, but you don’t know the other attributes, for example, when different systems manage different aspects of your data. For this, you can use the partialUpdateObjects method and only pass the changed data. Anything you don’t specify remains untouched.
var response = await client.PartialUpdateObjectsAsync(
  "ALGOLIA_INDEX_NAME",
  new List<Object>
  {
    new Dictionary<string, string> { { "objectID", "1" }, { "name", "Adam" } },
    new Dictionary<string, string> { { "objectID", "2" }, { "name", "Benoit" } },
  },
  true
);

Delete records

Whenever you delete data in your data source, you can delete the corresponding record from Algolia with deleteObjects.
var response = await client.DeleteObjectsAsync(
  "ALGOLIA_INDEX_NAME",
  new List<string> { "1", "2" }
);

Delete by query

Sometimes, you may need to delete all records matching a certain filter. Back to the book example, if you stop selling books from a specific publisher, you might want to delete all records matching this publisher in your index. To do this, you can use the deleteBy method.
The deleteBy method is an expensive operation for the engine. For better performance, use the deleteObjects method instead.
var response = await client.DeleteByAsync(
  "ALGOLIA_INDEX_NAME",
  new DeleteByParams { Filters = "brand:brandName" }
);
Any attribute you’re using to delete by needs to be in your searchableAttributes.
Last modified on January 28, 2026