取得服務統計資料 (預覽 REST API)
適用于:2023-07-01-Preview、2021-04-30-Preview
重要
2023-07-01-Preview 會將 vectorIndexSize 新增至搜尋服務。
2021-04-30-Preview 新增 aliasesCount。
服務統計資料作業會傳回您服務中的物件數目和類型、每個物件類型所允許的最大數目,指定服務層級、實際和最大儲存體,以及依階層而有所不同的其他限制。 此要求會從服務提取資訊,因此您不需要查閱或計算 服務限制。
文件計數和儲存體大小的統計資料會每隔幾分鐘收集,不會即時收集。 因此,此 API 所傳回的統計資料可能不會反映最新的索引作業所造成的變更。
GET https://[service name].search.windows.net/servicestats?api-version=[api-version]
Content-Type: application/json
api-key: [admin key]
URI 參數
參數 | Description |
---|---|
服務名稱 | 必要。 將此值設定為搜尋服務的唯一使用者定義名稱。 要求 URI 會指定應該傳回統計資料的索引名稱。 |
api-version | 必要。 目前的預覽版本是 2023-07-01-Preview 。 如需更多版本,請參閱 API 版本 。 |
要求標頭
下表說明必要及選用的要求標頭。
欄位 | Description |
---|---|
Content-Type | 必要。 將此值設定為 application/json |
api-key | 如果您使用 Azure 角色 ,而且要求會提供持有人權杖,則為選擇性,否則需要金鑰。 API 金鑰是唯一的系統產生字串,可驗證對搜尋服務的要求。 取得搜尋服務的要求必須包含 api-key 設定為系統管理員金鑰的標頭, (而不是查詢金鑰) 。 如需詳細資訊 ,請參閱使用金鑰驗證連線到 Azure AI 搜尋 服務。 |
要求本文
無。
回應
狀態碼:傳回 「200 OK」 以取得成功的回應。 回應本文的格式如下:
{
"counters": {
"documentCount": {
"usage": number,
"quota": number | null (if the service has unlimited document counts, the quota will be null)
},
"indexesCount": {
"usage": number,
"quota": number
},
"indexersCount": {
"usage": number,
"quota": number
},
"dataSourcesCount": {
"usage": number,
"quota": number
},
"storageSize": {
"usage": number (bytes),
"quota": number (bytes)
},
"synonymMaps": {
"usage": number,
"quota": number
},
"aliasesCount": {
"usage": number,
"quota": number
},
"vectorIndexSize": {
"usage": number (bytes),
"quota": number (bytes)
}
},
"limits": {
"maxFieldsPerIndex": number,
"maxIndexerRunTime": string,
"maxFileExtractionSize": number,
"maxFileContentCharactersToExtract": number,
"maxFieldNestingDepthPerIndex": number,
"maxComplexCollectionFieldsPerIndex": number,
"maxComplexObjectsInCollectionsPerDocument": number
}
}
統計資料 | 類型 | Description |
---|---|---|
documentCount | Count | 所有索引中所有檔的匯總。 舊版的 Azure AI 搜尋服務強制執行檔計數限制,但該限制已不存在。 配額一律為 Null,表示服務可以有無限制的檔計數。 |
indexesCount | Count | 搜尋服務上的索引數目。 最大索引會依階層而有所不同,如配額所報告。 |
indexersCount | Count | 搜尋服務上的索引子數目。 索引子上限會依階層而有所不同,如配額所報告。 |
dataSourcesCount | Count | 搜尋服務上的資料來源數目。 資料來源上限會依階層而有所不同,如配額所報告。 資料來源數目上限與索引子數目上限相同。 |
aliasesCount | Count | 搜尋服務上的索引別名數目。 上限會依層級而有所不同,如配額所報告。 |
synonymMaps | Count | 搜尋服務上的同義字對應數目。 上限會依層級而有所不同,如配額所報告。 |
storageSize | 位元組 | 使用量是服務上所有物件所使用的儲存體數量。 配額是根據您服務所設定的資料分割大小和數目,可用的儲存體上限。 配額增加和減少,以回應搜尋服務中布建的資料分割數目。 分割區大小會依階層而有所不同。 |
vectorIndexSize | 位元組 | 向量索引是內部結構,每個向量欄位一個向量索引,如搜尋索引中所定義。 服務的總使用量會報告,讓您可以監視相對於搜尋服務的向量索引限制的向量空間耗用量。 配額會依搜尋服務的存留期、分割區數目和資料分割的大小而有所不同,視階層而定。 |
如需所有限制的詳細資訊,請參閱 服務限制 。
範例
此 API 是資料平面。 若要取得服務的詳細資訊,例如其階層或位置,請參閱 管理 REST API。
{
"@odata.context": "https://my-search-service.search.windows.net/$metadata#Microsoft.Azure.Search.V2019_05_06.ServiceStatistics",
"counters": {
"documentCount": {
"usage": 5072,
"quota": null
},
"indexesCount": {
"usage": 10,
"quota": 15
},
"indexersCount": {
"usage": 8,
"quota": 15
},
"dataSourcesCount": {
"usage": 9,
"quota": 15
},
"storageSize": {
"usage": 22265221,
"quota": 2147483648
},
"synonymMaps": {
"usage": 0,
"quota": 3
},
"aliasesCount": {
"usage": 7,
"quota": 30
},
"vectorIndexSize": {
"usage": 1342476,
"quota": 1073741824
},
"limits": {
"maxFieldsPerIndex": 1000,
"maxIndexerRunTime": "P1D",
"maxFileExtractionSize": 16777216,
"maxFileContentCharactersToExtract": 65536,
"maxFieldNestingDepthPerIndex": 10,
"maxComplexCollectionFieldsPerIndex": 40,
"maxComplexObjectsInCollectionsPerDocument": 3000
}
}