共用方式為


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

Sample Request

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

Sample Response

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

定義

名稱 Description
GetIndexStatisticsResult

指定索引的統計數據。 統計數據會定期收集,不保證一律為最新狀態。

SearchError

描述 API 的錯誤狀況。

GetIndexStatisticsResult

指定索引的統計數據。 統計數據會定期收集,不保證一律為最新狀態。

名稱 類型 Description
documentCount

integer

索引中的文件數目。

storageSize

integer

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

vectorIndexSize

integer

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

SearchError

描述 API 的錯誤狀況。

名稱 類型 Description
code

string

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

details

SearchError[]

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

message

string

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