SearchIndexClient.DeleteIndexAsync Method

Definition

Overloads

DeleteIndexAsync(String, CancellationToken)

Deletes a search index and all the documents it contains.

DeleteIndexAsync(SearchIndex, Boolean, CancellationToken)

Deletes a search index and all the documents it contains.

DeleteIndexAsync(String, CancellationToken)

Deletes a search index and all the documents it contains.

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

Parameters

indexName
String

Required. The name of the SearchIndex to delete.

cancellationToken
CancellationToken

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

Returns

Task<Response>

The Response from the server.

Exceptions

Thrown when indexName is null.

Thrown when a failure is returned by the Search service.

Applies to

DeleteIndexAsync(SearchIndex, Boolean, CancellationToken)

Deletes a search index and all the documents it contains.

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

Parameters

index
SearchIndex

Required. The SearchIndex to delete.

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

Task<Response>

The Response from the server.

Exceptions

Thrown when index is null.

Thrown when a failure is returned by the Search service.

Applies to