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

Indexes - Get Statistics

返回给定索引的统计信息,包括文档计数和存储使用情况。

GET {endpoint}/indexes('{indexName}')/search.stats?api-version=2023-10-01-Preview

URI 参数

名称 在 必需 类型 说明
endpoint
path True

string

搜索服务的终结点 URL。

indexName
path True

string

要为其检索统计信息的索引的名称。

api-version
query True

string

客户端 API 版本。

请求头

名称 必需 类型 说明
x-ms-client-request-id

string (uuid)

随请求一起发送的跟踪 ID,以帮助进行调试。

响应

名称 类型 说明
200 OK

GetIndexStatisticsResult

Other Status Codes

SearchError

错误响应。

示例

SearchServiceGetIndexStatistics

示例请求

GET https://myservice.search.windows.net/indexes('hotels')/search.stats?api-version=2023-10-01-Preview

示例响应

{
  "documentCount": 239572,
  "storageSize": 72375920,
  "vectorIndexSize": 123456
}

定义

名称 说明
GetIndexStatisticsResult

给定索引的统计信息。 统计信息会定期收集,不保证始终 up-to日期。

SearchError

描述 API 的错误条件。

GetIndexStatisticsResult

给定索引的统计信息。 统计信息会定期收集,不保证始终 up-to日期。

名称 类型 说明
documentCount

integer (int64)

索引中的文档数。

storageSize

integer (int64)

索引使用的存储量(以字节为单位)。

vectorIndexSize

integer (int64)

索引中向量使用的内存量(以字节为单位)。

SearchError

描述 API 的错误条件。

名称 类型 说明
code

string

服务器定义的错误代码集之一。

details

SearchError[]

导致此报告错误的特定错误的详细信息数组。

message

string

错误的人工可读表示形式。