Indexes - Get Statistics
返回给定索引的统计信息,包括文档计数和存储使用情况。
GET {endpoint}/indexes('{indexName}')/search.stats?api-version=2025-09-01
URI 参数
| 名称 | 在 | 必需 | 类型 | 说明 |
|---|---|---|---|---|
|
endpoint
|
path | True |
string |
搜索服务的终结点 URL。 |
|
index
|
path | True |
string |
要检索其统计信息的索引的名称。 |
|
api-version
|
query | True |
string |
客户端 API 版本。 |
请求头
| 名称 | 必需 | 类型 | 说明 |
|---|---|---|---|
| x-ms-client-request-id |
string (uuid) |
随请求一起发送的跟踪 ID,以帮助调试。 |
响应
| 名称 | 类型 | 说明 |
|---|---|---|
| 200 OK | ||
| Other Status Codes |
错误响应。 |
示例
SearchServiceGetIndexStatistics
示例请求
GET https://stableexampleservice.search.windows.net/indexes('stable-test')/search.stats?api-version=2025-09-01
示例响应
{
"documentCount": 12,
"storageSize": 123456,
"vectorIndexSize": 123456
}
定义
| 名称 | 说明 |
|---|---|
|
Error |
资源管理错误附加信息。 |
|
Error |
错误详细信息。 |
|
Error |
错误响应 |
|
Get |
给定索引的统计信息。 统计数据是定期收集的,不能保证总是 up-to日期。 |
ErrorAdditionalInfo
资源管理错误附加信息。
| 名称 | 类型 | 说明 |
|---|---|---|
| info |
object |
其他信息。 |
| type |
string |
其他信息类型。 |
ErrorDetail
错误详细信息。
| 名称 | 类型 | 说明 |
|---|---|---|
| additionalInfo |
错误附加信息。 |
|
| code |
string |
错误代码。 |
| details |
错误详细信息。 |
|
| message |
string |
错误消息。 |
| target |
string |
错误目标。 |
ErrorResponse
错误响应
| 名称 | 类型 | 说明 |
|---|---|---|
| error |
错误对象。 |
GetIndexStatisticsResult
给定索引的统计信息。 统计数据是定期收集的,不能保证总是 up-to日期。
| 名称 | 类型 | 说明 |
|---|---|---|
| documentCount |
integer (int64) |
索引中的文档数。 |
| storageSize |
integer (int64) |
索引消耗的存储量(以字节为单位)。 |
| vectorIndexSize |
integer (int64) |
索引中的向量消耗的内存量(以字节为单位)。 |