Indexes - Get Statistics
傳回指定索引的統計資料,包括文件計數和儲存使用量。
GET {endpoint}/indexes('{indexName}')/search.stats?api-version=2026-04-01
URI 參數
| 名稱 | 位於 | 必要 | 類型 | Description |
|---|---|---|---|---|
|
endpoint
|
path | True |
string (uri) |
搜尋服務的端點 URL。 |
|
index
|
path | True |
string |
索引的名稱。 |
|
api-version
|
query | True |
string minLength: 1 |
用於此作業的 API 版本。 |
要求標頭
| 名稱 | 必要 | 類型 | Description |
|---|---|---|---|
| Accept |
接受標頭。 |
||
| x-ms-client-request-id |
string (uuid) |
一個不透明、全域唯一、由客戶端產生的請求字串識別碼。 |
回應
| 名稱 | 類型 | Description |
|---|---|---|
| 200 OK |
要求已成功。 |
|
| Other Status Codes |
未預期的錯誤回應。 |
安全性
api-key
類型:
apiKey
位於:
header
OAuth2Auth
類型:
oauth2
Flow:
implicit
授權 URL:
https://login.microsoftonline.com/common/oauth2/v2.0/authorize
範圍
| 名稱 | Description |
|---|---|
| https://search.azure.com/.default |
範例
SearchServiceGetIndexStatistics
範例要求
GET https://exampleservice.search.windows.net/indexes('example-index')/search.stats?api-version=2026-04-01
範例回覆
{
"documentCount": 12,
"storageSize": 123456,
"vectorIndexSize": 123456
}
定義
| 名稱 | Description |
|---|---|
| Accept |
接受標頭。 |
|
Error |
資源管理錯誤附加資訊。 |
|
Error |
錯誤詳細資料。 |
|
Error |
所有 Azure Resource Manager API 的常見錯誤回應,用於回傳失敗操作的錯誤細節。 (這也遵循 OData 錯誤回應格式。)。 |
|
Get |
指定索引的統計數據。 統計數據會定期收集,不保證一律 up-to-date。 |
Accept
接受標頭。
| 值 | Description |
|---|---|
| application/json;odata.metadata=minimal |
ErrorAdditionalInfo
資源管理錯誤附加資訊。
| 名稱 | 類型 | Description |
|---|---|---|
| info |
附加資訊。 |
|
| type |
string |
其他資訊類型。 |
ErrorDetail
錯誤詳細資料。
| 名稱 | 類型 | Description |
|---|---|---|
| additionalInfo |
錯誤附加資訊。 |
|
| code |
string |
錯誤碼。 |
| details |
錯誤詳情 |
|
| message |
string |
錯誤訊息。 |
| target |
string |
錯誤目標。 |
ErrorResponse
所有 Azure Resource Manager API 的常見錯誤回應,用於回傳失敗操作的錯誤細節。 (這也遵循 OData 錯誤回應格式。)。
| 名稱 | 類型 | Description |
|---|---|---|
| error |
錯誤物件。 |
GetIndexStatisticsResult
指定索引的統計數據。 統計數據會定期收集,不保證一律 up-to-date。
| 名稱 | 類型 | Description |
|---|---|---|
| documentCount |
integer (int64) |
索引中的文件數目。 |
| storageSize |
integer (int64) |
索引所耗用的儲存體數量 (以位元組為單位)。 |
| vectorIndexSize |
integer (int64) |
索引中向量所耗用的記憶體數量 (以位元組為單位)。 |