C# quickstart for Azure AI Search
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
- Visual Studio
- Azure AI Search service
- Azure.Search.Documents and the Azure SDK for .NET
Set up the sample
- Clone or download this sample repository.
- Extract contents if the download is a zip file. Make sure the files are read-write.
- Get the service name and admin API key of your service. You can find this information in the Azure portal.
Run the sample
- Open the AzureSearchQuickstart-v11.sln project in Visual Studio
- Open Program.cs.
- Replace the placeholder values for service name and admin API key with valid values for your search service.
- Compile and run the project.
Next steps
You can learn more about Azure AI Search on the official documentation site.