Method: stats.getIndex
Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Nhận số liệu thống kê về mục được lập chỉ mục được tổng hợp trên tất cả các nguồn dữ liệu. API này chỉ trả về số liệu thống kê cho các ngày trước đó; không trả về số liệu thống kê cho ngày hiện tại.
Lưu ý: API này yêu cầu tài khoản người dùng cuối tiêu chuẩn để thực thi.
Yêu cầu HTTP
GET https://cloudsearch.googleapis.com/v1/stats/index
URL sử dụng cú pháp Chuyển mã gRPC.
Tham số truy vấn
Thông số |
fromDate |
object (Date )
Ngày bắt đầu của phạm vi ngày để truy xuất số liệu thống kê. Giá trị này phải trong vòng 1 năm kể từ ngày hiện tại.
|
toDate |
object (Date )
Ngày kết thúc của phạm vi ngày để truy xuất số liệu thống kê. Giá trị này phải nằm trong vòng 1 năm kể từ ngày hiện tại và lớn hơn fromDate.
|
Nội dung yêu cầu
Nội dung yêu cầu phải trống.
Nội dung phản hồi
Nếu thành công, phần nội dung phản hồi sẽ chứa dữ liệu có cấu trúc sau:
Biểu diễn dưới dạng JSON |
{
"stats": [
{
object (CustomerIndexStats )
}
],
"averageIndexedItemCount": string
} |
Trường |
stats[] |
object (CustomerIndexStats )
Thông tin tóm tắt về số lượng mục được lập chỉ mục, mỗi ngày một mục trong phạm vi được yêu cầu.
|
averageIndexedItemCount |
string (int64 format)
Số mặt hàng trung bình trong phạm vi ngày nhất định mà hệ thống thực hiện việc tính phí.
|
Phạm vi uỷ quyền
Yêu cầu một trong các phạm vi OAuth sau:
https://www.googleapis.com/auth/cloud_search.stats.indexing
https://www.googleapis.com/auth/cloud_search.stats
https://www.googleapis.com/auth/cloud_search
Để biết thêm thông tin, hãy xem Hướng dẫn uỷ quyền.
CustomerIndexStats
Tổng hợp các mục theo mã trạng thái kể từ ngày được chỉ định.
Biểu diễn dưới dạng JSON |
{
"date": {
object (Date )
},
"itemCountByStatus": [
{
object (ItemCountByStatus )
}
]
} |
Trường |
date |
object (Date )
Ngày tính toán số liệu thống kê.
|
itemCountByStatus[] |
object (ItemCountByStatus )
Số lượng mặt hàng được tổng hợp theo mã trạng thái.
|
Trừ phi có lưu ý khác, nội dung của trang này được cấp phép theo Giấy phép ghi nhận tác giả 4.0 của Creative Commons và các mẫu mã lập trình được cấp phép theo Giấy phép Apache 2.0. Để biết thông tin chi tiết, vui lòng tham khảo Chính sách trang web của Google Developers. Java là nhãn hiệu đã đăng ký của Oracle và/hoặc các đơn vị liên kết với Oracle.
Cập nhật lần gần đây nhất: 2025-07-25 UTC.
[null,null,["Cập nhật lần gần đây nhất: 2025-07-25 UTC."],[],[],null,["# Method: stats.getIndex\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Query parameters](#body.QUERY_PARAMETERS)\n- [Request body](#body.request_body)\n- [Response body](#body.response_body)\n - [JSON representation](#body.GetCustomerIndexStatsResponse.SCHEMA_REPRESENTATION)\n- [Authorization scopes](#body.aspect)\n- [CustomerIndexStats](#CustomerIndexStats)\n - [JSON representation](#CustomerIndexStats.SCHEMA_REPRESENTATION)\n- [Try it!](#try-it)\n\nGets indexed item statistics aggreggated across all data sources. This API only returns statistics for previous dates; it doesn't return statistics for the current day.\n\n**Note:** This API requires a standard end user account to execute.\n\n### HTTP request\n\n`GET https://cloudsearch.googleapis.com/v1/stats/index`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Query parameters\n\n| Parameters ||\n|------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `fromDate` | `object (`[Date](/workspace/cloud-search/docs/reference/rest/v1/Date)`)` Start of the date range to retrieve statistics for. This value must be within 1 year of the current date. |\n| `toDate` | `object (`[Date](/workspace/cloud-search/docs/reference/rest/v1/Date)`)` End of the date range to retrieve statistics for. This value must be within 1 year of the current date and greater than fromDate. |\n\n### Request body\n\nThe request body must be empty.\n\n### Response body\n\nIf successful, the response body contains data with the following structure:\n\n| JSON representation |\n|-----------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"stats\": [ { object (/workspace/cloud-search/docs/reference/rest/v1/stats/getIndex#CustomerIndexStats) } ], \"averageIndexedItemCount\": string } ``` |\n\n| Fields ||\n|---------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `stats[]` | `object (`[CustomerIndexStats](/workspace/cloud-search/docs/reference/rest/v1/stats/getIndex#CustomerIndexStats)`)` Summary of indexed item counts, one for each day in the requested range. |\n| `averageIndexedItemCount` | `string (`[int64](https://developers.google.com/discovery/v1/type-format)` format)` Average item count for the given date range for which billing is done. |\n\n### Authorization scopes\n\nRequires one of the following OAuth scopes:\n\n- `https://www.googleapis.com/auth/cloud_search.stats.indexing`\n- `https://www.googleapis.com/auth/cloud_search.stats`\n- `https://www.googleapis.com/auth/cloud_search`\n\nFor more information, see the [Authorization guide](/workspace/guides/configure-oauth-consent).\n\nCustomerIndexStats\n------------------\n\nAggregation of items by status code as of the specified date.\n\n| JSON representation |\n|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"date\": { object (/workspace/cloud-search/docs/reference/rest/v1/Date) }, \"itemCountByStatus\": [ { object (/workspace/cloud-search/docs/reference/rest/v1/stats.index.datasources#ItemCountByStatus) } ] } ``` |\n\n| Fields ||\n|-----------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `date` | `object (`[Date](/workspace/cloud-search/docs/reference/rest/v1/Date)`)` The date for which statistics were calculated. |\n| `itemCountByStatus[]` | `object (`[ItemCountByStatus](/workspace/cloud-search/docs/reference/rest/v1/stats.index.datasources#ItemCountByStatus)`)` Number of items aggregrated by status code. |"]]