Share via


SearchIndexClient.GetIndexStatisticsAsync(String, CancellationToken) Method

Definition

Gets SearchIndexStatistics for the given index, including a document count and storage usage.

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

Parameters

indexName
String

Required. The name of the index.

cancellationToken
CancellationToken

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

Returns

The Response<T> from the server containing SearchIndexStatistics.

Exceptions

Thrown when indexName is null.

Thrown when a failure is returned by the Search service.

Applies to