Skip to main content
The latest major version of the Algolia.Search package is version 7. This page lists the breaking changes introduced since the previous major release, version 6.

Method changes overview

The following table has links for all methods and their replacements

Search API client

Version 6 (legacy)Version 7 (current)
client.AddApiKeyclient.AddApiKey
client.AddApiKey.waitclient.WaitForApiKey
DictionaryClient.ClearDictionaryEntriesclient.BatchDictionaryEntries
client.CopyIndexclient.OperationIndex
client.CopyRulesclient.OperationIndex
client.CopySynonymsclient.OperationIndex
client.DeleteApiKeyclient.DeleteApiKey
DictionaryClient.DeleteDictionaryEntriesclient.BatchDictionaryEntries
client.GenerateSecuredApiKeyclient.GenerateSecuredApiKey
client.GetApiKeyclient.GetApiKey
client.GetSecuredApiKeyRemainingValidityclient.GetSecuredApiKeyRemainingValidity
client.ListApiKeysclient.ListApiKeys
client.ListIndicesclient.ListIndices
client.MoveIndexclient.OperationIndex
client.MultipleBatchclient.MultipleBatch
client.MultipleQueriesclient.Search
DictionaryClient.ReplaceDictionaryEntriesclient.BatchDictionaryEntries
client.RestoreApiKeyclient.RestoreApiKey
DictionaryClient.SaveDictionaryEntriesclient.BatchDictionaryEntries
client.UpdateApiKeyclient.UpdateApiKey
index.Batchclient.Batch
index.Browseclient.BrowseObjects
index.BrowseRulesclient.BrowseRules
index.BrowseSynonymsclient.BrowseSynonyms
index.ClearObjectsclient.ClearObjects
index.ClearRulesclient.ClearRules
index.ClearSynonymsclient.ClearSynonyms
index.CopySettingsclient.OperationIndex
index.Deleteclient.DeleteIndex
index.DeleteByclient.DeleteBy
index.DeleteObjectclient.DeleteObject
index.DeleteObjectsclient.DeleteObjects
index.DeleteRuleclient.DeleteRule
index.DeleteSynonymclient.DeleteSynonym
index.FindObjectclient.SearchSingleIndex
index.GetObjectclient.GetObject
index.GetObjectsclient.GetObjects
index.GetRuleclient.GetRule
index.GetSettingsclient.GetSettings
index.GetSynonymclient.GetSynonym
index.GetTaskclient.GetTask
index.PartialUpdateObjectclient.PartialUpdateObject
index.PartialUpdateObjectsclient.PartialUpdateObjects
index.ReplaceAllObjectsclient.ReplaceAllObjects
index.ReplaceAllRulesclient.SaveRules
index.ReplaceAllSynonymsclient.SaveSynonyms
index.SaveObjectclient.SaveObject
index.SaveObjectsclient.SaveObjects
index.SaveRuleclient.SaveRule
index.SaveRulesclient.SaveRules
index.SaveSynonymclient.SaveSynonym
index.SaveSynonymsclient.SaveSynonyms
index.Searchclient.SearchSingleIndex
index.SearchForFacetValuesclient.SearchForFacetValues
index.SearchRulesclient.SearchRules
index.SearchSynonymsclient.SearchSynonyms
index.SetSettingsclient.SetSettings
index.{operation}.waitclient.WaitForTask

Recommend API client

Version 6 (legacy)Version 7 (current)
client.GetFrequentlyBoughtTogetherclient.GetRecommendations
client.GetRecommendationsclient.GetRecommendations
client.GetRelatedProductsclient.GetRecommendations

Removal of InitIndex

All methods are methods of a client instance. The InitIndex method of the SearchClient class has been removed. Instead, all methods require a indexName parameter.
C#
// version 6
var client = new SearchClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY");
var index = client.InitIndex("ALGOLIA_INDEX_NAME");

// version 7
var client = new SearchClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY");
client.SearchSingleIndex<Hit>(
    "ALGOLIA_INDEX_NAME",
    new SearchParams(new SearchParamsObject { Query = "QUERY"})
);

Wait for tasks

The Wait method has been removed. Instead, use one of the following helpers:

Copy or move indices, settings, synonyms, or rules

Use the OperationIndex method, which replaces the following methods:
  • CopyIndex
  • MoveIndex
  • CopyRules
  • CopySynonyms
  • CopySettings

Serialization library

The Algolia.Search package no longer depends on the Newtonsoft.Json package to serialize the request and deserialize the response. The API client uses .NET’s official System.Text.Json package. If you were using the Newtonsoft.Json package for custom serialization, see Migrate from Newtonsoft.Json to System.Text.Json in Microsoft’s documentation.

Enumeration type 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#
[JsonConverter(typeof(JsonStringEnumConverter))]
public enum MyEnum
{
    MyValue1,
    MyValue2
}

public class MyModel
{
    public MyEnum MyProperty { get; set; }
}

client.SaveObjectAsync("MyIndex", new MyModel { MyProperty = MyEnum.MyValue2 })
With this, the MyProperty property will be serialized as string ("MyValue2) instead of an integer (1).
I