Skip to main content
Based on the Batch operations on one index API operation. This method creates a batch write request with the addObject action and automatically sends records in batches of 1,000. This method is subject to indexing rate limits.

Usage

var response = await client.SaveObjectsAsync(
  "ALGOLIA_INDEX_NAME",
  new List<Object>
  {
    new Dictionary<string, string>
    {
      { "objectID", "1" },
      { "visibility", "public" },
      { "name", "Hot 100 Billboard Charts" },
      { "playlistId", "d3e8e8f3-0a4f-4b7d-9b6b-7e8f4e8e3a0f" },
      { "createdAt", "1500240452" },
    },
  },
  false,
  1000,
  new RequestOptionBuilder().AddExtraHeader("X-Algolia-User-ID", "*").Build()
);

Parameters

  • C#
  • Go
  • Java
  • JavaScript
  • Kotlin
  • PHP
  • Python
  • Ruby
  • Scala
  • Swift
indexName
string
required
Name of the index to which to add records.
objects
IEnumerable<T>
required
Records to add.
T
type parameter
required
The model of your index’s records.
waitForTasks
bool
default:false
Whether to wait until all batch requests are done.
batchSize
int
default:1000
Number of records to process in one batch.
requestOptions
RequestOptions
Additional request options.
I