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

SearchIndexClient.CreateIndexAsync(SearchIndex, CancellationToken) 方法

定义

创建新的搜索索引。

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

参数

index
SearchIndex

必需。 要创建的 SearchIndex

cancellationToken
CancellationToken

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

返回

Response<T>包含SearchIndex创建的 的服务器的 。 这可能与传入的内容略有不同,因为服务可能会返回设置为其默认值的字段,具体取决于字段类型和其他属性。

例外

index 为 null 时引发。

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

适用于