Gives API access to all Algolia functionality, settings, advanced features, and ML/AI products
Installation options: .NET CLI, Nuget Package Manager Console, Nuget.org
Every request and response are typed
POCOs
Background retry strategy to ensure uptime
Batching via iterators to optimize number of network calls
Zero downtime reindexing feature
Injectable HTTP client
Asynchronous and synchronous methods to interact with Algolia's API
.NET Standard 1.3 to .NET Standard 2.1,
.NET Core 1.0 to .NET Core 3.0,
.NET Framework 4.5 to .NET Framework 4.7.1
.NET API for C# and F#
Supports ASP.NET, MVC, WebAPI
INDEX
List<Contact> contacts = new List<Contact>
{
new Contact { ObjectID = "myID1", Firstname = "Jimmie", Lastname = "Barninger" },
new Contact { ObjectID = "myID2", Firstname = "Warren", Lastname = "Speach" }
};
index.SaveObjects(contacts);
// Asynchronous
await index.SaveObjectsAsync(contacts);
SEARCH
SearchIndex index = client.SearchIndex("contacts");
// Synchronous
var result = index.Search<Contact>(new Query("query string"));
// Synchronous with settings
var result = index.Search<Contact>(new Query("query string")
{
AttributesToRetrieve = new List<string> { "firstname", "lastname" }
HitsPerPage = 50
});
// Asynchronous
var result = await index.SearchAsync<Contact>(new Query("query string"));
// Asynchronous with settings
var result = await index.SearchAsync<Contact>(new Query("query string")
{
AttributesToRetrieve = new List<string> { "firstname", "lastname" }
HitsPerPage = 50
});