Share via


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

SearchIndexerClient.CreateOrUpdateIndexerAsync 方法

定义

创建新的索引器或更新现有的索引器。

public virtual System.Threading.Tasks.Task<Azure.Response<Azure.Search.Documents.Indexes.Models.SearchIndexer>> CreateOrUpdateIndexerAsync (Azure.Search.Documents.Indexes.Models.SearchIndexer indexer, bool onlyIfUnchanged = false, bool? ignoreCacheResetRequirements = default, bool? disableCacheReprocessingChangeDetection = default, System.Threading.CancellationToken cancellationToken = default);
abstract member CreateOrUpdateIndexerAsync : Azure.Search.Documents.Indexes.Models.SearchIndexer * bool * Nullable<bool> * Nullable<bool> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.Search.Documents.Indexes.Models.SearchIndexer>>
override this.CreateOrUpdateIndexerAsync : Azure.Search.Documents.Indexes.Models.SearchIndexer * bool * Nullable<bool> * Nullable<bool> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.Search.Documents.Indexes.Models.SearchIndexer>>
Public Overridable Function CreateOrUpdateIndexerAsync (indexer As SearchIndexer, Optional onlyIfUnchanged As Boolean = false, Optional ignoreCacheResetRequirements As Nullable(Of Boolean) = Nothing, Optional disableCacheReprocessingChangeDetection As Nullable(Of Boolean) = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of Response(Of SearchIndexer))

参数

indexer
SearchIndexer

必需。 要 SearchIndexer 创建或更新的 。

onlyIfUnchanged
Boolean

如果 ETag 与当前服务版本不匹配,则为 True,则引发 RequestFailedException ;否则,将覆盖当前服务版本。

disableCacheReprocessingChangeDetectionignoreCacheResetRequirements
Nullable<Boolean>

禁用缓存重新处理更改检测。

ignoreCacheResetRequirementsdisableCacheReprocessingChangeDetection
Nullable<Boolean>

忽略缓存重置要求。

cancellationToken
CancellationToken

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

返回

Response<T>包含SearchIndexer创建的 的服务器的 。 这可能与传递到服务的内容略有不同。

例外

indexer 为 null 时引发。

当搜索服务返回失败时引发。

适用于