Method: query.sources.list
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.
Trả về danh sách các nguồn mà người dùng có thể sử dụng cho API Tìm kiếm và Đề xuất.
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. Tài khoản dịch vụ không thể trực tiếp thực hiện các yêu cầu API truy vấn; để sử dụng tài khoản dịch vụ thực hiện truy vấn, hãy thiết lập tính năng uỷ quyền trên toàn miền Google Workspace.
Yêu cầu HTTP
GET https://cloudsearch.googleapis.com/v1/query/sources
URL sử dụng cú pháp Chuyển mã gRPC.
Tham số truy vấn
Thông số |
requestOptions |
object (RequestOptions )
Các tuỳ chọn yêu cầu, chẳng hạn như ứng dụng tìm kiếm và múi giờ của người dùng.
|
pageToken |
string
Số lượng nguồn sẽ trả về trong phản hồi.
|
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
Phản hồi danh sách nguồn.
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 |
{
"sources": [
{
object (QuerySource )
}
],
"nextPageToken": string
} |
Trường |
sources[] |
object (QuerySource )
|
nextPageToken |
string
|
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.query
https://www.googleapis.com/auth/cloud_search
Để biết thêm thông tin, hãy xem Hướng dẫn uỷ quyền.
QuerySource
Danh sách nguồn mà người dùng có thể tìm kiếm bằng API truy vấn.
Biểu diễn dưới dạng JSON |
{
"source": {
object (Source )
},
"shortName": string,
"displayName": string,
"operators": [
{
object (QueryOperator )
}
]
} |
Trường |
source |
object (Source )
Tên nguồn
|
shortName |
string
Tên ngắn hoặc bí danh cho nguồn. Bạn có thể sử dụng giá trị này với toán tử "nguồn".
|
displayName |
string
Tên hiển thị của nguồn dữ liệu.
|
operators[] |
object (QueryOperator )
Danh sách tất cả toán tử áp dụng cho nguồn này.
|
QueryOperator
Định nghĩa về toán tử có thể được sử dụng trong yêu cầu Tìm kiếm/query.suggest.
Biểu diễn dưới dạng JSON |
{
"operatorName": string,
"lessThanOperatorName": string,
"greaterThanOperatorName": string,
"type": enum (QueryOperator.Type ),
"displayName": string,
"isSortable": boolean,
"isFacetable": boolean,
"isReturnable": boolean,
"isRepeatable": boolean,
"isSuggestable": boolean,
"enumValues": [
string
],
"objectType": string
} |
Trường |
operatorName |
string
Tên của nhà mạng.
|
lessThanOperatorName |
string
Cho biết tên toán tử có thể dùng để tách biệt thuộc tính bằng toán tử nhỏ hơn.
|
greaterThanOperatorName |
string
Cho biết tên toán tử có thể dùng để tách riêng thuộc tính bằng toán tử lớn hơn.
|
type |
enum (QueryOperator.Type )
Loại toán tử.
|
displayName |
string
Tên hiển thị của nhà mạng
|
isSortable |
boolean
Có thể sử dụng toán tử này để sắp xếp kết quả không?
|
isFacetable |
boolean
Có thể sử dụng toán tử này để lấy các mặt không?
|
isReturnable |
boolean
Tài sản được liên kết với phương diện này có được trả về trong kết quả tìm kiếm không.
|
isRepeatable |
boolean
Cho biết liệu có thể đặt nhiều giá trị cho thuộc tính này hay không.
|
isSuggestable |
boolean
Có thể nhận được đề xuất cho trường này.
|
enumValues[] |
string
Danh sách các giá trị tiềm năng cho trường toán tử. Trường này chỉ được điền khi chúng ta có thể liệt kê an toàn tất cả các giá trị có thể có của toán tử này.
|
objectType |
string
Tên của đối tượng tương ứng với toán tử. Trường này chỉ được điền cho các toán tử dành riêng cho giản đồ và không được đặt cho các toán tử phổ biến.
|
QueryOperator.Type
Loại thuộc tính mà toán tử tham chiếu đến.
Enum |
UNKNOWN |
Giá trị không hợp lệ. |
INTEGER |
|
DOUBLE |
|
TIMESTAMP |
|
BOOLEAN |
|
ENUM |
|
DATE |
|
TEXT |
|
HTML |
|
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: query.sources.list\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.ListQuerySourcesResponse.SCHEMA_REPRESENTATION)\n- [Authorization scopes](#body.aspect)\n- [QuerySource](#QuerySource)\n - [JSON representation](#QuerySource.SCHEMA_REPRESENTATION)\n- [QueryOperator](#QueryOperator)\n - [JSON representation](#QueryOperator.SCHEMA_REPRESENTATION)\n- [QueryOperator.Type](#QueryOperator.Type)\n- [Try it!](#try-it)\n\nReturns list of sources that user can use for Search and Suggest APIs.\n\n**Note:** This API requires a standard end user account to execute. A service account can't perform query API requests directly; to use a service account to perform queries, set up [Google Workspace domain-wide delegation of authority](https://developers.google.com/workspace/cloud-search/docs/guides/delegation/).\n\n### HTTP request\n\n`GET https://cloudsearch.googleapis.com/v1/query/sources`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Query parameters\n\n| Parameters ||\n|------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `requestOptions` | `object (`[RequestOptions](/workspace/cloud-search/docs/reference/rest/v1/RequestOptions)`)` Request options, such as the search application and user timezone. |\n| `pageToken` | `string` Number of sources to return in the response. |\n\n### Request body\n\nThe request body must be empty.\n\n### Response body\n\nList sources response.\n\nIf successful, the response body contains data with the following structure:\n\n| JSON representation |\n|------------------------------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"sources\": [ { object (/workspace/cloud-search/docs/reference/rest/v1/query.sources/list#QuerySource) } ], \"nextPageToken\": string } ``` |\n\n| Fields ||\n|-----------------|-----------------------------------------------------------------------------------------------------------|\n| `sources[]` | `object (`[QuerySource](/workspace/cloud-search/docs/reference/rest/v1/query.sources/list#QuerySource)`)` |\n| `nextPageToken` | `string` |\n\n### Authorization scopes\n\nRequires one of the following OAuth scopes:\n\n- `https://www.googleapis.com/auth/cloud_search.query`\n- `https://www.googleapis.com/auth/cloud_search`\n\nFor more information, see the [Authorization guide](/workspace/guides/configure-oauth-consent).\n\nQuerySource\n-----------\n\nList of sources that the user can search using the query API.\n\n| JSON representation |\n|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"source\": { object (/workspace/cloud-search/docs/reference/rest/v1/settings.searchapplications#Source) }, \"shortName\": string, \"displayName\": string, \"operators\": [ { object (/workspace/cloud-search/docs/reference/rest/v1/query.sources/list#QueryOperator) } ] } ``` |\n\n| Fields ||\n|---------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `source` | `object (`[Source](/workspace/cloud-search/docs/reference/rest/v1/settings.searchapplications#Source)`)` The name of the source |\n| `shortName` | `string` A short name or alias for the source. This value can be used with the 'source' operator. |\n| `displayName` | `string` Display name of the data source. |\n| `operators[]` | `object (`[QueryOperator](/workspace/cloud-search/docs/reference/rest/v1/query.sources/list#QueryOperator)`)` List of all operators applicable for this source. |\n\nQueryOperator\n-------------\n\nThe definition of a operator that can be used in a Search/query.suggest request.\n\n| JSON representation |\n|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"operatorName\": string, \"lessThanOperatorName\": string, \"greaterThanOperatorName\": string, \"type\": enum (/workspace/cloud-search/docs/reference/rest/v1/query.sources/list#QueryOperator.Type), \"displayName\": string, \"isSortable\": boolean, \"isFacetable\": boolean, \"isReturnable\": boolean, \"isRepeatable\": boolean, \"isSuggestable\": boolean, \"enumValues\": [ string ], \"objectType\": string } ``` |\n\n| Fields ||\n|---------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `operatorName` | `string` The name of the operator. |\n| `lessThanOperatorName` | `string` Indicates the operator name that can be used to isolate the property using the less-than operator. |\n| `greaterThanOperatorName` | `string` Indicates the operator name that can be used to isolate the property using the greater-than operator. |\n| `type` | `enum (`[QueryOperator.Type](/workspace/cloud-search/docs/reference/rest/v1/query.sources/list#QueryOperator.Type)`)` The type of the operator. |\n| `displayName` | `string` Display name of the operator |\n| `isSortable` | `boolean` Can this operator be used to sort results. |\n| `isFacetable` | `boolean` Can this operator be used to get facets. |\n| `isReturnable` | `boolean` Will the property associated with this facet be returned as part of search results. |\n| `isRepeatable` | `boolean` Indicates if multiple values can be set for this property. |\n| `isSuggestable` | `boolean` Can get suggestions for this field. |\n| `enumValues[]` | `string` Potential list of values for the opeatror field. This field is only filled when we can safely enumerate all the possible values of this operator. |\n| `objectType` | `string` The name of the object corresponding to the operator. This field is only filled for schema-specific operators, and is unset for common operators. |\n\nQueryOperator.Type\n------------------\n\nThe type of the property referred by the operator.\n\n| Enums ||\n|-------------|----------------|\n| `UNKNOWN` | Invalid value. |\n| `INTEGER` | |\n| `DOUBLE` | |\n| `TIMESTAMP` | |\n| `BOOLEAN` | |\n| `ENUM` | |\n| `DATE` | |\n| `TEXT` | |\n| `HTML` | |"]]