共用方式為


SearchClientBuilderExtensions.AddSearchClient Method

Definition

Overloads

AddSearchClient<TBuilder,TConfiguration>(TBuilder, TConfiguration)

Registers a SearchClient instance with connection options loaded from the provided configuration instance.

AddSearchClient<TBuilder>(TBuilder, Uri, String, AzureKeyCredential)

Registers a SearchClient instance with the provided endpoint, indexName, and credential.

AddSearchClient<TBuilder,TConfiguration>(TBuilder, TConfiguration)

Source:
SearchClientBuilderExtensions.cs
Source:
SearchClientBuilderExtensions.cs

Registers a SearchClient instance with connection options loaded from the provided configuration instance.

public static Azure.Core.Extensions.IAzureClientBuilder<Azure.Search.Documents.SearchClient,Azure.Search.Documents.SearchClientOptions> AddSearchClient<TBuilder,TConfiguration> (this TBuilder builder, TConfiguration configuration) where TBuilder : Azure.Core.Extensions.IAzureClientFactoryBuilderWithConfiguration<TConfiguration>;
static member AddSearchClient : 'Builder * 'Configuration -> Azure.Core.Extensions.IAzureClientBuilder<Azure.Search.Documents.SearchClient, Azure.Search.Documents.SearchClientOptions> (requires 'Builder :> Azure.Core.Extensions.IAzureClientFactoryBuilderWithConfiguration<'Configuration>)
<Extension()>
Public Function AddSearchClient(Of TBuilder As IAzureClientFactoryBuilderWithConfiguration(Of TConfiguration), TConfiguration As IAzureClientFactoryBuilderWithConfiguration(Of TConfiguration)) (builder As TBuilder, configuration As TConfiguration) As IAzureClientBuilder(Of SearchClient, SearchClientOptions)

Type Parameters

TBuilder

Type of the client factory builder.

TConfiguration

Type of the configuration.

Parameters

builder
TBuilder

The client factory builder.

configuration
TConfiguration

The client configuration.

Returns

An Azure client builder.

Applies to

AddSearchClient<TBuilder>(TBuilder, Uri, String, AzureKeyCredential)

Source:
SearchClientBuilderExtensions.cs
Source:
SearchClientBuilderExtensions.cs

Registers a SearchClient instance with the provided endpoint, indexName, and credential.

public static Azure.Core.Extensions.IAzureClientBuilder<Azure.Search.Documents.SearchClient,Azure.Search.Documents.SearchClientOptions> AddSearchClient<TBuilder> (this TBuilder builder, Uri endpoint, string indexName, Azure.AzureKeyCredential credential) where TBuilder : Azure.Core.Extensions.IAzureClientFactoryBuilder;
static member AddSearchClient : 'Builder * Uri * string * Azure.AzureKeyCredential -> Azure.Core.Extensions.IAzureClientBuilder<Azure.Search.Documents.SearchClient, Azure.Search.Documents.SearchClientOptions> (requires 'Builder :> Azure.Core.Extensions.IAzureClientFactoryBuilder)
<Extension()>
Public Function AddSearchClient(Of TBuilder As IAzureClientFactoryBuilder) (builder As TBuilder, endpoint As Uri, indexName As String, credential As AzureKeyCredential) As IAzureClientBuilder(Of SearchClient, SearchClientOptions)

Type Parameters

TBuilder

Type of the client factory builder.

Parameters

builder
TBuilder

The client factory builder.

endpoint
Uri

Required. The URI endpoint of the Search Service. This is likely to be similar to "https://{search_service}.search.windows.net". The URI must use HTTPS.

indexName
String

Required. The name of the Search Index.

credential
AzureKeyCredential

Required. The API key credential used to authenticate requests against the search service. You need to use an admin key to modify the documents in a Search Index. See Create and manage api-keys for an Azure Cognitive Search service for more information about API keys in Azure Cognitive Search.

Returns

An Azure client builder.

Applies to