Share via

C# quickstart for Azure AI Search

Flask sample MIT license badge

This quickstart is focused on the fundamentals: creating, loading, and querying a search index.

New and legacy versions are provided so that you can learn these operations with the client libraries used in your solution. Both versions create a search index that is modeled on a subset of the built-in Hotels dataset, reduced in this quickstart for readability and comprehension. Index definition and documents are included in the code. When you run the program, a console window emits output messages for each step: deleting and then re-creating a hotels-quickstart-csharp index, loading documents, running queries.

Prerequisites

Set up the sample

  1. Clone or download this sample repository.
  2. Extract contents if the download is a zip file. Make sure the files are read-write.
  3. Get the service name and admin API key of your service. You can find this information in the Azure portal.

Run the sample

  1. Open the AzureSearchQuickstart-v11.sln project in Visual Studio
  2. Open Program.cs.
  3. Replace the placeholder values for service name and admin API key with valid values for your search service.
  4. Compile and run the project.

Next steps

You can learn more about Azure AI Search on the official documentation site.