Method: query.sources.list
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
ユーザーが Search API と Suggest API で使用できるソースのリストを返します。
注: この API を実行するには、標準のエンドユーザー アカウントが必要です。サービス アカウントはクエリ API リクエストを直接実行できません。サービス アカウントを使用してクエリを実行するには、Google Workspace ドメイン全体の権限の委任を設定します。
HTTP リクエスト
GET https://cloudsearch.googleapis.com/v1/query/sources
この URL は gRPC Transcoding 構文を使用します。
クエリ パラメータ
パラメータ |
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
列挙型 |
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` | |"]]