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

SearchIndexClient.CreateOrUpdateKnowledgeBaseAsync Method

Definition

Creates a new knowledge base or updates an knowledge base if it already exists.

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

Parameters

KnowledgeBase
KnowledgeBase

The definition of the knowledge base to create or update.

onlyIfUnchanged
Boolean

True to throw a RequestFailedException if the ETag does not match the current service version; otherwise, the current service version will be overwritten.

cancellationToken
CancellationToken

Optional CancellationToken to propagate notifications that the operation should be canceled.

Returns

Exceptions

KnowledgeBase is null.

Applies to