共用方式為


取得服務統計資料 (預覽 REST API)

適用於:2023-07-01-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 參數

參數 描述
服務名稱 必填。 將此值設定為搜尋服務的唯一用戶定義名稱。 要求 URI 會指定應該傳回統計數據的索引名稱。
api-version 必填。 如需更多版本,請參閱 API 版本

要求標頭

下表描述必要和選擇性的要求標頭。

領域 描述
Content-Type 必填。 將此值設定為 application/json
api-key 如果您使用 Azure 角色,而且要求會提供持有人令牌,則為選擇性,否則需要密鑰。 api-key 是唯一的系統產生字串,可驗證對搜尋服務的要求。 針對搜尋服務取得要求必須包含設定為系統管理密鑰的 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
    }
}
統計 類型 描述
documentCount 計數 所有索引中所有文件的匯總。 舊版的 Azure AI 搜尋會強制執行檔計數限制,但該限制已不存在。 配額一律為 Null,表示服務可以有無限制的文件計數。
indexesCount 計數 搜尋服務上的索引數目。 索引上限會依階層而有所不同,如配額所報告。
indexersCount 計數 搜尋服務上的索引器數目。 索引器上限會依階層而有所不同,如配額所報告。
dataSourcesCount 計數 搜尋服務上的資料源數目。 依配額回報的數據源上限會依階層而有所不同。 數據源上限與索引器的數目相同。
aliasesCount 計數 搜尋服務上的索引別名數目。 最大值會依階層而有所不同,如配額所報告。
synonymMaps 計數 搜尋服務上的同義字對應數目。 最大值會依階層而有所不同,如配額所報告。
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
    }
}

另請參閱