Method: query.sources.list
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
แสดงรายการแหล่งที่มาที่ผู้ใช้สามารถใช้สำหรับ Search และ Suggest API
หมายเหตุ: API นี้ต้องใช้บัญชีผู้ใช้ปลายทางมาตรฐานเพื่อดำเนินการ บัญชีบริการไม่สามารถส่งคําขอไปยัง Query API ได้โดยตรง หากต้องการใช้บัญชีบริการเพื่อทำการค้นหา ให้ตั้งค่าการมอบสิทธิ์ทั้งโดเมนของ Google Workspace
คำขอ HTTP
GET https://cloudsearch.googleapis.com/v1/query/sources
URL ใช้ไวยากรณ์การแปลง gRPC
พารามิเตอร์การค้นหา
พารามิเตอร์ |
requestOptions |
object (RequestOptions )
ตัวเลือกคำขอ เช่น แอปพลิเคชันการค้นหาและเขตเวลาของผู้ใช้
|
pageToken |
string
จํานวนแหล่งที่มาที่จะแสดงในการตอบกลับ
|
เนื้อหาของคำขอ
เนื้อหาของคำขอต้องว่างเปล่า
เนื้อหาการตอบกลับ
แสดงรายการการตอบกลับแหล่งที่มา
หากทำสำเร็จ เนื้อหาการตอบกลับจะมีข้อมูลซึ่งมีโครงสร้างดังต่อไปนี้
การแสดง JSON |
{
"sources": [
{
object (QuerySource )
}
],
"nextPageToken": string
} |
ช่อง |
sources[] |
object (QuerySource )
|
nextPageToken |
string
|
ขอบเขตการให้สิทธิ์
ต้องใช้ขอบเขต OAuth ต่อไปนี้
https://www.googleapis.com/auth/cloud_search.query
https://www.googleapis.com/auth/cloud_search
ดูข้อมูลเพิ่มเติมได้ที่คู่มือการให้สิทธิ์
QuerySource
รายการแหล่งที่มาที่ผู้ใช้ค้นหาได้โดยใช้ Query API
การแสดง JSON |
{
"source": {
object (Source )
},
"shortName": string,
"displayName": string,
"operators": [
{
object (QueryOperator )
}
]
} |
ช่อง |
source |
object (Source )
ชื่อแหล่งที่มา
|
shortName |
string
ชื่อย่อหรือชื่อแทนของแหล่งที่มา ค่านี้ใช้ได้กับโอเปอเรเตอร์ "source"
|
displayName |
string
ชื่อที่แสดงของแหล่งข้อมูล
|
operators[] |
object (QueryOperator )
รายการโอเปอเรเตอร์ทั้งหมดที่ใช้ได้กับแหล่งที่มานี้
|
QueryOperator
คําจํากัดความของโอเปอเรเตอร์ที่ใช้ได้ในคําขอ Search/query.suggest
การแสดง 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
} |
ช่อง |
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
ชื่อออบเจ็กต์ที่สอดคล้องกับโอเปอเรเตอร์ ระบบจะกรอกข้อมูลในช่องนี้สําหรับโอเปอเรเตอร์เฉพาะสคีมาเท่านั้น และจะไม่ตั้งค่าสําหรับโอเปอเรเตอร์ทั่วไป
|
QueryOperator.Type
ประเภทที่พักที่ผู้ดำเนินการอ้างถึง
Enum |
UNKNOWN |
ค่าไม่ถูกต้อง |
INTEGER |
|
DOUBLE |
|
TIMESTAMP |
|
BOOLEAN |
|
ENUM |
|
DATE |
|
TEXT |
|
HTML |
|
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-25 UTC
[null,null,["อัปเดตล่าสุด 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` | |"]]