Skip to main content
The latest major version of the Algolia.Search package is version 7. This page helps you upgrade from version 6 and explains the breaking changes you need to address. Algolia generates the version 7 clients from OpenAPI specifications, which provides consistent behavior across all languages and up-to-date API coverage. The main architectural change is the removal of the InitIndex pattern: all methods are now on the client instance directly, with indexName as a parameter. For the full list of changes, see the C# changelog.

Update your dependencies

Update the Algolia.Search package to version 7:
Command line
Version 7 replaces the Newtonsoft.Json dependency with System.Text.Json. If your project relies on Newtonsoft-specific attributes or converters, see Update the serialization library for migration guidance.

Update imports

The package name remains Algolia.Search, but several model types have been renamed. For example, the Query class no longer exists. It’s replaced by SearchParams and SearchParamsObject.
C#
The SearchClient class stays in the same namespace. As you update your code, your IDE will flag missing types and suggest the correct using directives for the new model classes.

Update client initialization

Client creation is unchanged. The constructor still accepts your application ID and API key:
C#
The other major change concerns what follows initialization: InitIndex no longer exists.

Synchronous and asynchronous methods

Version 7 includes both synchronous and asynchronous variants for every API method. Asynchronous methods have an Async suffix and return a Task<T>. Synchronous methods keep the base name.
C#
The code examples in this guide use the asynchronous variants. If you prefer synchronous calls, drop the Async suffix and the await keyword.

Remove InitIndex

This is the most significant change when upgrading. Version 6 relied on an index object with methods called on it. In version 7, all methods belong to the client instance, with indexName as a parameter.
C#
If you have many files to update, search your codebase for InitIndex or .InitIndex( to find every place that needs changing.

Update search calls

Search a single index

The index.Search() method is now client.SearchSingleIndexAsync(). Pass the index name and search parameters directly:
C#

Search multiple indices

The client.MultipleQueries() method is now client.SearchAsync(). Each request in the collection requires an IndexName:
C#

Search for facet values

The index.SearchForFacetValues() method becomes client.SearchForFacetValuesAsync() with an indexName parameter:
C#

Update indexing operations

In version 7, indexing methods are on the client instead of the index object, with indexName as a parameter.

Add or replace records

C#

Partially update records

C#

Delete records

C#

Update settings, synonyms, and rules

Get and set settings

C#

Save synonyms and rules

C#
In version 6, index.ReplaceAllRules() and index.ReplaceAllSynonyms() replaced all rules or synonyms. In version 7, use client.SaveRulesAsync() or client.SaveSynonymsAsync() with the clearExistingRules or clearExistingSynonyms parameter set to true.

Update index management

The CopyIndex, MoveIndex, CopyRules, CopySynonyms, and CopySettings methods are all replaced by OperationIndexAsync.

Copy an index

C#

Move (rename) an index

C#

Copy only rules or settings

In version 7, use the Scope parameter to limit the operation to specific data:
C#
You can also pass the Operation and Destination parameters through the constructor:
C#

Check if an index exists

In version 6, you could check if an index existed using the Exists method on the index object. In version 7, use the IndexExists helper method on the client:
C#

Update task handling

Version 6 supported chaining .Wait() on operations. Version 7 replaces this pattern with dedicated wait helpers.
C#
Version 7 includes three wait helpers:

Update the serialization library

The Algolia.Search package no longer depends on Newtonsoft.Json for request serialization and response deserialization. Version 7 uses .NET’s official System.Text.Json package instead. This is a significant change if your project relies on Newtonsoft.Json attributes (such as [JsonProperty]) for custom serialization of your Algolia records. If you were using the Newtonsoft.Json package for custom serialization, see Migrate from Newtonsoft.Json to System.Text.Json in Microsoft’s documentation.
Common attribute replacements when migrating from Newtonsoft.Json:
  • [JsonProperty("name")] becomes [JsonPropertyName("name")]
  • [JsonIgnore] keeps the same name but moves to the System.Text.Json.Serialization namespace
  • Custom JsonConverter implementations need rewriting for System.Text.Json

Update enumeration serialization

To keep the serialization of enumeration types consistent with previous versions of the .NET API client, they’re serialized as int by default. To serialize enumeration types as strings, use the JsonStringEnumConverter attribute from System.Text.Json.Serialization:
C#
With this attribute, MyProperty serializes as the string "MyValue2" instead of the integer 1.

Helper method changes

The following sections document breaking changes in helper method signatures and behavior between version 6 and version 7.

ReplaceAllObjects

The safe parameter has been removed. In version 6, safe: true caused the helper to wait after each step. In version 7, the helper always waits—equivalent to the previous safe: true behavior. The scopes parameter is optional. When omitted, it defaults to all three scopes: Settings, Rules, and Synonyms.
C#

SaveObjects

The autoGenerateObjectId parameter has been removed. In version 7, every object must include an ObjectID. To have the API generate object IDs, use the ChunkedBatch helper with Action.AddObject.
C#

PartialUpdateObjects

The createIfNotExists parameter is now a required argument—it no longer has a default value.
C#

GenerateSecuredApiKey

The method was renamed from the plural GenerateSecuredApiKeys to the singular GenerateSecuredApiKey.
C#

BrowseObjects, BrowseRules, BrowseSynonyms

These helpers no longer return iterator types (IndexIterator<T>, RulesIterator, SynonymsIterator). In version 7, they return IEnumerable<T> directly. The index name is now a separate string parameter, and the params object has changed to BrowseParamsObject, SearchRulesParams, and SearchSynonymsParams respectively.
C#

DeleteObjects

Two new optional parameters are available:
  • waitForTasks (default false)
  • batchSize (default 1,000)
C#

WaitForTask

The method was renamed from WaitTask to WaitForTask. It now returns GetTaskResponse instead of void, adds explicit maxRetries (default 100) and a timeout function (default: retry delay that increases exponentially, up to 5 seconds) instead of the timeToWait integer.
C#

WaitForAppTask

This is a new helper in version 7.
C#

WaitForApiKey

This is a new standalone helper in version 7.
C#

GetSecuredApiKeyRemainingValidity

This helper is new in version 7.
C#

IndexExists

This helper is new in version 7.
C#

ChunkedBatch

ChunkedBatch is now a public helper. In version 6, chunking was an internal detail of SaveObjects. The waitForTasks parameter defaults to false and batchSize defaults to 1,000.
C#

CopyIndexBetweenApplications

In version 6, AccountClient provided CopyIndex<T> and CopyIndexAsync<T> for copying an index between two different Algolia applications. It accepted two ISearchIndex objects. In version 7, AccountClient is removed. You can compose existing helpers across two clients to achieve the same result.
C#

SaveObjectsWithTransformation

In version 7 and later: routes records with the Push to Algolia connector. Requires a client created with SearchClient.WithTransformation, passing TransformationOptions with a region. The SetTransformationRegion method is deprecated. Use WithTransformation or SetTransformationOptions instead.
C#

ReplaceAllObjectsWithTransformation

In version 7 and later: atomically replaces all records with the Push to Algolia connector. It copies settings, rules, and synonyms to a temporary index, pushes records to the temporary index, and moves the temporary index back. Requires a client created with SearchClient.WithTransformation, passing TransformationOptions with a region. The SetTransformationRegion method is deprecated. Use WithTransformation or SetTransformationOptions instead.
C#

PartialUpdateObjectsWithTransformation

In version 7 and later: routes partial updates with the Push to Algolia connector. The createIfNotExists parameter defaults to true.
C#

Method changes reference

The following tables list all method names that changed between version 6 and version 7.

Search API client

Recommend API client

Last modified on June 10, 2026