Indexes - Get Statistics

傳回指定索引的統計數據,包括檔計數和記憶體使用量。

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

URI 參數

名稱 位於 必要 類型 Description
endpoint
path True

string

搜尋服務的端點 URL。

indexName
path True

string

要擷取統計數據的索引名稱。

api-version
query True

string

用戶端 API 版本。

要求標頭

名稱 必要 類型 Description
x-ms-client-request-id

string (uuid)

隨要求一起傳送的追蹤標識碼,以協助偵錯。

回應

名稱 類型 Description
200 OK

GetIndexStatisticsResult

Other Status Codes

SearchError

錯誤回應。

範例

SearchServiceGetIndexStatistics

範例要求

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

範例回覆

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

定義

名稱 Description
GetIndexStatisticsResult

指定索引的統計數據。 統計數據會定期收集,不保證一律 up-to-date。

SearchError

描述 API 的錯誤狀況。

GetIndexStatisticsResult

指定索引的統計數據。 統計數據會定期收集,不保證一律 up-to-date。

名稱 類型 Description
documentCount

integer (int64)

索引中的文件數目。

storageSize

integer (int64)

索引所耗用位元組的記憶體數量。

vectorIndexSize

integer (int64)

索引中向量所耗用的位元組記憶體數量。

SearchError

描述 API 的錯誤狀況。

名稱 類型 Description
code

string

其中一組伺服器定義的錯誤碼。

details

SearchError[]

導致此錯誤之特定錯誤的詳細數據陣列。

message

string

錯誤的人類可讀取表示法。