Azure Search libraries for .NET

Overview

Azure Search is a fully managed cloud search service that provides a rich search experience over data in web, mobile, and enterprise applications.

Client library

Use the Azure Search client library to access and execute indexing and search operations on a search service, index, documents, or other object. For a step-by-step introduction, see How to use Azure Search from a .NET application.

Install the NuGet package directly from the Visual Studio Package Manager console or with the .NET Core CLI.

Visual Studio Package Manager

Install-Package Microsoft.Azure.Search
dotnet add package Microsoft.Azure.Search

Code Example

/* Include these 'using' directives:
   using Microsoft.Azure.Search;
   using Microsoft.Azure.Search.Models;
*/

// A service endpoint and an api-key are required on a connection.
// Set them in a config file (not shown) and then connect to the client.
IConfigurationBuilder builder = new ConfigurationBuilder().AddJsonFile("appsettings.json");
IConfigurationRoot configuration = builder.Build();

SearchServiceClient serviceClient = CreateSearchServiceClient(configuration);

// Create an index named hotels
ISearchIndexClient indexClient = serviceClient.Indexes.GetClient("hotels");

Management library

Use the Azure Search management library to provision a service, manage api-keys, and adjust resources. Service management has a dependency on Azure Resource Manager for subscriber and tenant identification. Typically, authentication and application registration with Azure Active Directory is also necessary to support the workflow. For an introduction to Azure Search service provisioning, see How to use the Management REST API.

Install the NuGet package directly from the Visual Studio Package Manager console or with the .NET Core CLI.

Visual Studio Package Manager

Install-Package Microsoft.Azure.Management.Search
dotnet add package Microsoft.Azure.Management.Search

Samples

Find more search samples in the Azure samples repository on Github.