From 750a1e5a9b6ae1cc4417d87ab461ade0019797d4 Mon Sep 17 00:00:00 2001 From: David Pine Date: Wed, 12 Jun 2024 20:16:17 -0500 Subject: [PATCH] Fix incorrect API, and add xrefs. Fixes #1050 --- docs/azureai/azureai-search-document-component.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/azureai/azureai-search-document-component.md b/docs/azureai/azureai-search-document-component.md index cc603d43e9..6dd9d5055c 100644 --- a/docs/azureai/azureai-search-document-component.md +++ b/docs/azureai/azureai-search-document-component.md @@ -2,7 +2,7 @@ title: .NET Aspire Azure AI Search Documents component description: Learn how to use the .NET Aspire Azure AI Search Documents component. ms.topic: how-to -ms.date: 06/05/2024 +ms.date: 06/12/2024 --- # .NET Aspire Azure AI Search Documents component @@ -37,10 +37,10 @@ For more information, see [dotnet add package](/dotnet/core/tools/dotnet-add-pac ## Example usage -In the _:::no-loc text="Program.cs":::_ file of your component-consuming project, call the extension method to register an `SearchIndexClient` for use via the dependency injection container. The method takes a connection name parameter. +In the _:::no-loc text="Program.cs":::_ file of your component-consuming project, call the extension method to register an `SearchIndexClient` for use via the dependency injection container. The method takes a connection name parameter. ```csharp -builder.AddAzureSearch("searchConnectionName"); +builder.AddAzureSearchClient("searchConnectionName"); ``` You can then retrieve the `SearchIndexClient` instance using dependency injection. For example, to retrieve the client from an example service: @@ -105,7 +105,7 @@ var myService = builder.AddProject() .WithReference(search); ``` -The `AddAzureSearch` method will read connection information from the AppHost's configuration (for example, from "user secrets") under the `ConnectionStrings:search` config key. The `WithReference` method passes that connection information into a connection string named `search` in the `MyService` project. In the _:::no-loc text="Program.cs":::_ file of `MyService`, the connection can be consumed using: +The method will read connection information from the AppHost's configuration (for example, from "user secrets") under the `ConnectionStrings:search` config key. The `WithReference` method passes that connection information into a connection string named `search` in the `MyService` project. In the _:::no-loc text="Program.cs":::_ file of `MyService`, the connection can be consumed using: ```csharp builder.AddAzureSearch("search");