Search API Client for C#.NET
A computer on a search page, with recommendations being inserted on the side
Algolia C# .NET Client

Version

  • .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

Related Integrations

Key links


Get started

Install (get a free account here)

1dotnet add package Algolia.Search

Index

1List<Contact> contacts = new List<Contact>
2{
3    new Contact { ObjectID = "myID1", Firstname = "Jimmie", Lastname = "Barninger" },
4    new Contact { ObjectID = "myID2", Firstname = "Warren", Lastname = "Speach" }
5};
6
7index.SaveObjects(contacts);
8
9// Asynchronous
10await index.SaveObjectsAsync(contacts);

Search

1SearchIndex index = client.SearchIndex("contacts");
2
3// Synchronous
4var result = index.Search<Contact>(new Query("query string"));
5
6// Synchronous with settings
7var result = index.Search<Contact>(new Query("query string")
8{
9  AttributesToRetrieve = new List<string> { "firstname", "lastname" }
10  HitsPerPage = 50
11});
12
13// Asynchronous
14var result = await index.SearchAsync<Contact>(new Query("query string"));
15
16// Asynchronous with settings
17var result = await index.SearchAsync<Contact>(new Query("query string")
18{
19    AttributesToRetrieve = new List<string> { "firstname", "lastname" }
20    HitsPerPage = 50
21});
Get started for freeExplore all developer docs

Built with Algolia

Frontend Tools
Templates & Starters

Autocomplete Playground

Typeahead dropdown playground built with the Algolia Autocomplete library

  • javascript