[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["難以理解","hardToUnderstand","thumb-down"],["資訊或程式碼範例有誤","incorrectInformationOrSampleCode","thumb-down"],["缺少我需要的資訊/範例","missingTheInformationSamplesINeed","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2025-08-17 (世界標準時間)。"],[[["\u003cp\u003eThe \u003ccode\u003eINFORMATION_SCHEMA.SEARCH_INDEX_COLUMNS\u003c/code\u003e view provides metadata for each search-indexed column within a dataset, with one row per indexed column.\u003c/p\u003e\n"],["\u003cp\u003eAccess to this view requires specific IAM permissions, namely \u003ccode\u003ebigquery.tables.get\u003c/code\u003e or \u003ccode\u003ebigquery.tables.list\u003c/code\u003e, which are included in roles such as \u003ccode\u003eroles/bigquery.admin\u003c/code\u003e, \u003ccode\u003eroles/bigquery.dataViewer\u003c/code\u003e, and others.\u003c/p\u003e\n"],["\u003cp\u003eEach row in the view's schema includes details like \u003ccode\u003eindex_catalog\u003c/code\u003e (project name), \u003ccode\u003eindex_schema\u003c/code\u003e (dataset name), \u003ccode\u003etable_name\u003c/code\u003e, \u003ccode\u003eindex_name\u003c/code\u003e, \u003ccode\u003eindex_column_name\u003c/code\u003e, and \u003ccode\u003eindex_field_path\u003c/code\u003e which specifies the exact location of the indexed field.\u003c/p\u003e\n"],["\u003cp\u003eQueries on this view must include a dataset qualifier and are scoped to the dataset level and its location, as demonstrated by the example \u003ccode\u003emyDataset.INFORMATION_SCHEMA.SEARCH_INDEX_COLUMNS\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eindex_field_path\u003c/code\u003e differentiates itself from \u003ccode\u003eindex_column_name\u003c/code\u003e when it comes to structs, by providing the full path to the indexed field within the struct.\u003c/p\u003e\n"]]],[],null,["# SEARCH_INDEX_COLUMNS view\n=========================\n\nThe `INFORMATION_SCHEMA.SEARCH_INDEX_COLUMNS` view contains one row for each\nsearch-indexed column on each table in a dataset.\n\nRequired permissions\n--------------------\n\nTo see [search index](/bigquery/docs/search-index) metadata, you need the\n`bigquery.tables.get` or `bigquery.tables.list` Identity and Access Management (IAM)\npermission on the table with the index. Each of the following predefined\nIAM roles includes at least one of these permissions:\n\n- `roles/bigquery.admin`\n- `roles/bigquery.dataEditor`\n- `roles/bigquery.dataOwner`\n- `roles/bigquery.dataViewer`\n- `roles/bigquery.metadataViewer`\n- `roles/bigquery.user`\n\nFor more information about BigQuery permissions, see\n[Access control with IAM](/bigquery/docs/access-control).\n\nSchema\n------\n\nWhen you query the `INFORMATION_SCHEMA.SEARCH_INDEX_COLUMNS` view, the query results contain one row for each indexed column on each table in a dataset.\n\n\u003cbr /\u003e\n\nThe `INFORMATION_SCHEMA.SEARCH_INDEX_COLUMNS` view has the following schema:\n\nScope and syntax\n----------------\n\nQueries against this view must have a [dataset qualifier](/bigquery/docs/information-schema-intro#syntax). The\nfollowing table explains the region scope for this view:\n\nReplace the following:\n\n- Optional: \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: the ID of your Google Cloud project. If not specified, the default project is used.\n- \u003cvar translate=\"no\"\u003eDATASET_ID\u003c/var\u003e: the ID of your dataset. For more information, see [Dataset qualifier](/bigquery/docs/information-schema-intro#dataset_qualifier).\n\n\u003cbr /\u003e\n\n**Example** \n\n -- Returns metadata for search indexes in a single dataset.\n SELECT * FROM myDataset.INFORMATION_SCHEMA.SEARCH_INDEX_COLUMNS;\n\nExamples\n--------\n\nThe following example creates a search index on all columns of `my_table`. \n\n```googlesql\nCREATE TABLE dataset.my_table(\n a STRING,\n b INT64,\n c STRUCT \u003cd INT64,\n e ARRAY\u003cSTRING\u003e,\n f STRUCT\u003cg STRING, h INT64\u003e\u003e) AS\nSELECT 'hello' AS a, 10 AS b, (20, ['x', 'y'], ('z', 30)) AS c;\n\nCREATE SEARCH INDEX my_index\nON dataset.my_table(ALL COLUMNS);\n```\n\nThe following query extracts information on which fields are indexed.\nThe `index_field_path` indicates which field of a column is\nindexed. This differs from the `index_column_name` only in the case of a\n`STRUCT`, where the full path to the indexed field is given. In this example,\ncolumn `c` contains an `ARRAY\u003cSTRING\u003e` field `e` and another `STRUCT` called\n`f` which contains a `STRING` field `g`, each of which is indexed. \n\n SELECT table_name, index_name, index_column_name, index_field_path\n FROM my_project.dataset.INFORMATION_SCHEMA.SEARCH_INDEX_COLUMNS\n\nThe result is similar to the following: \n\n```\n+------------+------------+-------------------+------------------+\n| table_name | index_name | index_column_name | index_field_path |\n+------------+------------+-------------------+------------------+\n| my_table | my_index | a | a |\n| my_table | my_index | c | c.e |\n| my_table | my_index | c | c.f.g |\n+------------+------------+-------------------+------------------+\n```\n\nThe following query joins the `INFORMATION_SCHEMA.SEARCH_INDEX_COUMNS` view with\nthe `INFORMATION_SCHEMA.SEARCH_INDEXES` and `INFORMATION_SCHEMA.COLUMNS` views\nto include the search index status and the data type of each column: \n\n```googlesql\nSELECT\n index_columns_view.index_catalog AS project_name,\n index_columns_view.index_SCHEMA AS dataset_name,\n indexes_view.TABLE_NAME AS table_name,\n indexes_view.INDEX_NAME AS index_name,\n indexes_view.INDEX_STATUS AS status,\n index_columns_view.INDEX_COLUMN_NAME AS column_name,\n index_columns_view.INDEX_FIELD_PATH AS field_path,\n columns_view.DATA_TYPE AS data_type\nFROM\n mydataset.INFORMATION_SCHEMA.SEARCH_INDEXES indexes_view\nINNER JOIN\n mydataset.INFORMATION_SCHEMA.SEARCH_INDEX_COLUMNS index_columns_view\n ON\n indexes_view.TABLE_NAME = index_columns_view.TABLE_NAME\n AND indexes_view.INDEX_NAME = index_columns_view.INDEX_NAME\nLEFT OUTER JOIN\n mydataset.INFORMATION_SCHEMA.COLUMNS columns_view\n ON\n indexes_view.INDEX_CATALOG = columns_view.TABLE_CATALOG\n AND indexes_view.INDEX_SCHEMA = columns_view.TABLE_SCHEMA\n AND index_columns_view.TABLE_NAME = columns_view.TABLE_NAME\n AND index_columns_view.INDEX_COLUMN_NAME = columns_view.COLUMN_NAME\nORDER BY\n project_name,\n dataset_name,\n table_name,\n column_name;\n```\n\nThe result is similar to the following: \n\n```\n+------------+------------+----------+------------+--------+-------------+------------+---------------------------------------------------------------+\n| project | dataset | table | index_name | status | column_name | field_path | data_type |\n+------------+------------+----------+------------+--------+-------------+------------+---------------------------------------------------------------+\n| my_project | my_dataset | my_table | my_index | ACTIVE | a | a | STRING |\n| my_project | my_dataset | my_table | my_index | ACTIVE | c | c.e | STRUCT\u003cd INT64, e ARRAY\u003cSTRING\u003e, f STRUCT\u003cg STRING, h INT64\u003e\u003e |\n| my_project | my_dataset | my_table | my_index | ACTIVE | c | c.f.g | STRUCT\u003cd INT64, e ARRAY\u003cSTRING\u003e, f STRUCT\u003cg STRING, h INT64\u003e\u003e |\n+------------+------------+----------+------------+--------+-------------+------------+---------------------------------------------------------------+\n```\n\n\u003cbr /\u003e"]]