SearchClient Constructors
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
SearchClient() |
Initializes a new instance of the SearchClient class for mocking. |
SearchClient(Uri, String, AzureKeyCredential) |
Initializes a new instance of the SearchClient class for querying an index and uploading, merging, or deleting documents. |
SearchClient(Uri, String, TokenCredential) |
Initializes a new instance of the SearchClient class for querying an index and uploading, merging, or deleting documents. |
SearchClient(Uri, String, AzureKeyCredential, SearchClientOptions) |
Initializes a new instance of the SearchClient class for querying an index and uploading, merging, or deleting documents. |
SearchClient(Uri, String, TokenCredential, SearchClientOptions) |
Initializes a new instance of the SearchClient class for querying an index and uploading, merging, or deleting documents. |
SearchClient()
- Source:
- SearchClient.cs
- Source:
- SearchClient.cs
Initializes a new instance of the SearchClient class for mocking.
protected SearchClient ();
Protected Sub New ()
Applies to
SearchClient(Uri, String, AzureKeyCredential)
- Source:
- SearchClient.cs
- Source:
- SearchClient.cs
Initializes a new instance of the SearchClient class for querying an index and uploading, merging, or deleting documents.
public SearchClient (Uri endpoint, string indexName, Azure.AzureKeyCredential credential);
new Azure.Search.Documents.SearchClient : Uri * string * Azure.AzureKeyCredential -> Azure.Search.Documents.SearchClient
Public Sub New (endpoint As Uri, indexName As String, credential As AzureKeyCredential)
Parameters
- 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.
Exceptions
Thrown when the endpoint
,
indexName
, or credential
is
null.
Thrown when the endpoint
is not using HTTPS or
the indexName
is empty.
Applies to
SearchClient(Uri, String, TokenCredential)
- Source:
- SearchClient.cs
- Source:
- SearchClient.cs
Initializes a new instance of the SearchClient class for querying an index and uploading, merging, or deleting documents.
public SearchClient (Uri endpoint, string indexName, Azure.Core.TokenCredential tokenCredential);
new Azure.Search.Documents.SearchClient : Uri * string * Azure.Core.TokenCredential -> Azure.Search.Documents.SearchClient
Public Sub New (endpoint As Uri, indexName As String, tokenCredential As TokenCredential)
Parameters
- 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.
- tokenCredential
- TokenCredential
Required. The token credential used to authenticate requests against the Search service. See Use role-based authorization in Azure Cognitive Search for more information about role-based authorization in Azure Cognitive Search.
Exceptions
Thrown when the endpoint
,
indexName
, or tokenCredential
is
null.
Thrown when the endpoint
is not using HTTPS or
the indexName
is empty.
Applies to
SearchClient(Uri, String, AzureKeyCredential, SearchClientOptions)
- Source:
- SearchClient.cs
- Source:
- SearchClient.cs
Initializes a new instance of the SearchClient class for querying an index and uploading, merging, or deleting documents.
public SearchClient (Uri endpoint, string indexName, Azure.AzureKeyCredential credential, Azure.Search.Documents.SearchClientOptions options);
new Azure.Search.Documents.SearchClient : Uri * string * Azure.AzureKeyCredential * Azure.Search.Documents.SearchClientOptions -> Azure.Search.Documents.SearchClient
Public Sub New (endpoint As Uri, indexName As String, credential As AzureKeyCredential, options As SearchClientOptions)
Parameters
- 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.
- options
- SearchClientOptions
Client configuration options for connecting to Azure Cognitive Search.
Exceptions
Thrown when the endpoint
,
indexName
, or credential
is
null.
Thrown when the endpoint
is not using HTTPS or
the indexName
is empty.
Applies to
SearchClient(Uri, String, TokenCredential, SearchClientOptions)
- Source:
- SearchClient.cs
- Source:
- SearchClient.cs
Initializes a new instance of the SearchClient class for querying an index and uploading, merging, or deleting documents.
public SearchClient (Uri endpoint, string indexName, Azure.Core.TokenCredential tokenCredential, Azure.Search.Documents.SearchClientOptions options);
new Azure.Search.Documents.SearchClient : Uri * string * Azure.Core.TokenCredential * Azure.Search.Documents.SearchClientOptions -> Azure.Search.Documents.SearchClient
Public Sub New (endpoint As Uri, indexName As String, tokenCredential As TokenCredential, options As SearchClientOptions)
Parameters
- 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.
- tokenCredential
- TokenCredential
Required. The token credential used to authenticate requests against the Search service. See Use role-based authorization in Azure Cognitive Search for more information about role-based authorization in Azure Cognitive Search.
- options
- SearchClientOptions
Client configuration options for connecting to Azure Cognitive Search.
Exceptions
Thrown when the endpoint
,
indexName
, or tokenCredential
is
null.
Thrown when the endpoint
is not using HTTPS or
the indexName
is empty.
Applies to
意見反應
https://aka.ms/ContentUserFeedback。
即將登場:在 2024 年,我們將逐步淘汰 GitHub 問題作為內容的意見反應機制,並將它取代為新的意見反應系統。 如需詳細資訊,請參閱:提交並檢視相關的意見反應