Indexes - Get Statistics
Returns statistics for the given index, including a document count and storage usage.
GET {endpoint}/indexes('{indexName}')/search.stats?api-version=2023-10-01-Preview
URI Parameters
Name | In | Required | Type | Description |
---|---|---|---|---|
endpoint
|
path | True |
string |
The endpoint URL of the search service. |
index
|
path | True |
string |
The name of the index for which to retrieve statistics. |
api-version
|
query | True |
string |
Client Api Version. |
Request Header
Name | Required | Type | Description |
---|---|---|---|
x-ms-client-request-id |
string uuid |
The tracking ID sent with the request to help with debugging. |
Responses
Name | Type | Description |
---|---|---|
200 OK | ||
Other Status Codes |
Error response. |
Examples
SearchServiceGetIndexStatistics
Sample request
GET https://myservice.search.windows.net/indexes('hotels')/search.stats?api-version=2023-10-01-Preview
Sample response
{
"documentCount": 239572,
"storageSize": 72375920,
"vectorIndexSize": 123456
}
Definitions
Name | Description |
---|---|
Get |
Statistics for a given index. Statistics are collected periodically and are not guaranteed to always be up-to-date. |
Search |
Describes an error condition for the API. |
GetIndexStatisticsResult
Statistics for a given index. Statistics are collected periodically and are not guaranteed to always be up-to-date.
Name | Type | Description |
---|---|---|
documentCount |
integer |
The number of documents in the index. |
storageSize |
integer |
The amount of storage in bytes consumed by the index. |
vectorIndexSize |
integer |
The amount of memory in bytes consumed by vectors in the index. |
SearchError
Describes an error condition for the API.
Name | Type | Description |
---|---|---|
code |
string |
One of a server-defined set of error codes. |
details |
An array of details about specific errors that led to this reported error. |
|
message |
string |
A human-readable representation of the error. |