你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

SearchIndexClient.GetIndexAsync(String, CancellationToken) 方法

定义

获取特定的 SearchIndex

public virtual System.Threading.Tasks.Task<Azure.Response<Azure.Search.Documents.Indexes.Models.SearchIndex>> GetIndexAsync (string indexName, System.Threading.CancellationToken cancellationToken = default);
abstract member GetIndexAsync : string * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.Search.Documents.Indexes.Models.SearchIndex>>
override this.GetIndexAsync : string * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.Search.Documents.Indexes.Models.SearchIndex>>
Public Overridable Function GetIndexAsync (indexName As String, Optional cancellationToken As CancellationToken = Nothing) As Task(Of Response(Of SearchIndex))

参数

indexName
String

必需。 要获取的索引的名称。

cancellationToken
CancellationToken

可选 CancellationToken ,用于传播应取消操作的通知。

返回

Response<T>包含所请求的服务器中的 SearchIndex

例外

indexName 为 null 时引发。

当搜索服务返回故障时引发。

适用于