[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-09-04。"],[[["\u003cp\u003eThe \u003ccode\u003eINFORMATION_SCHEMA.SEARCH_INDEX_OPTIONS\u003c/code\u003e view provides details about search index options within a dataset, with each row representing a single option.\u003c/p\u003e\n"],["\u003cp\u003eYou need \u003ccode\u003ebigquery.tables.get\u003c/code\u003e or \u003ccode\u003ebigquery.tables.list\u003c/code\u003e IAM permissions on the indexed table to view search index metadata.\u003c/p\u003e\n"],["\u003cp\u003eThe view's schema includes columns like \u003ccode\u003eindex_catalog\u003c/code\u003e, \u003ccode\u003eindex_schema\u003c/code\u003e, \u003ccode\u003etable_name\u003c/code\u003e, \u003ccode\u003eindex_name\u003c/code\u003e, \u003ccode\u003eoption_name\u003c/code\u003e, \u003ccode\u003eoption_type\u003c/code\u003e, and \u003ccode\u003eoption_value\u003c/code\u003e, which describes various attributes of the index options.\u003c/p\u003e\n"],["\u003cp\u003eIf a search index option is not explicitly defined, the view will still display a row with the default values, specifically for the \u003ccode\u003eanalyzer\u003c/code\u003e and \u003ccode\u003edata_types\u003c/code\u003e options.\u003c/p\u003e\n"],["\u003cp\u003eQueries against this view must include a dataset qualifier, and the view operates at the dataset level within the specified dataset location.\u003c/p\u003e\n"]]],[],null,["# SEARCH_INDEX_OPTIONS view\n=========================\n\nThe `INFORMATION_SCHEMA.SEARCH_INDEX_OPTIONS` view contains one row for each\nsearch index option 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_OPTIONS` view, the query results contain one row for each search index option in a dataset.\n\n\u003cbr /\u003e\n\nThe `INFORMATION_SCHEMA.SEARCH_INDEX_OPTIONS` view has the following schema:\n\n| **Note:** If a search index option is not specified, a row containing the default search index option is produced by a query. The `analyzer` and `data_types` options are always populated in the `SEARCH_INDEX_OPTIONS` view regardless of whether they are specified in the DDL or not. If not specified, the default `LOG_ANALYZER` and `[\"STRING\"]` values are respectively produced. Other options are populated in the `SEARCH_INDEX_OPTIONS` view only when they're specified in `CREATE SEARCH INDEX DDL`.\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 index options in a single dataset.\n SELECT * FROM myDataset.INFORMATION_SCHEMA.SEARCH_INDEX_OPTIONS;\n\nExample\n-------\n\nThe following example creates three search index options for columns of\n`table1` and then extracts those options from fields that are indexed: \n\n```googlesql\nCREATE SEARCH INDEX myIndex ON `mydataset.table1` (ALL COLUMNS) OPTIONS (\n analyzer = 'LOG_ANALYZER',\n analyzer_options = '{ \"delimiters\" : [\".\", \"-\"] }',\n data_types = ['STRING', 'INT64', 'TIMESTAMP']\n);\n\nSELECT index_name, option_name, option_type, option_value\nFROM mydataset.INFORMATION_SCHEMA.SEARCH_INDEX_OPTIONS\nWHERE table_name='table1';\n```\n\nThe result is similar to the following: \n\n```\n+------------+------------------+---------------+----------------------------------+\n| index_name | option_name | option_type | option_value |\n+------------+------------------+---------------+----------------------------------+\n| myIndex | analyzer | STRING | LOG_ANALYZER |\n| myIndex | analyzer_options | STRING | { \"delimiters\": [\".\", \"-\"] } |\n| myIndex | data_types | ARRAY\u003cSTRING\u003e | [\"STRING\", \"INT64\", \"TIMESTAMP\"] |\n+------------+------------------+---------------+----------------------------------+\n```\n\nThe following example creates one search index option for columns of `table1`\nand then extracts those options from fields that are indexed. If an option\ndoesn't exist, the default option is produced: \n\n```googlesql\nCREATE SEARCH INDEX myIndex ON `mydataset.table1` (ALL COLUMNS) OPTIONS (\n analyzer = 'NO_OP_ANALYZER'\n);\n\nSELECT index_name, option_name, option_type, option_value\nFROM mydataset.INFORMATION_SCHEMA.SEARCH_INDEX_OPTIONS\nWHERE table_name='table1';\n```\n\nThe result is similar to the following: \n\n```\n+------------+------------------+---------------+----------------+\n| index_name | option_name | option_type | option_value |\n+------------+------------------+---------------+----------------+\n| myIndex | analyzer | STRING | NO_OP_ANALYZER |\n| myIndex | data_types | ARRAY\u003cSTRING\u003e | [\"STRING\"] |\n+------------+------------------+---------------+----------------+\n```\n\nThe following example creates no search index options for columns of `table1`\nand then extracts the default options from fields that are indexed: \n\n```googlesql\nCREATE SEARCH INDEX myIndex ON `mydataset.table1` (ALL COLUMNS);\n\nSELECT index_name, option_name, option_type, option_value\nFROM mydataset.INFORMATION_SCHEMA.SEARCH_INDEX_OPTIONS\nWHERE table_name='table1';\n```\n\nThe result is similar to the following: \n\n```\n+------------+------------------+---------------+----------------+\n| index_name | option_name | option_type | option_value |\n+------------+------------------+---------------+----------------+\n| myIndex | analyzer | STRING | LOG_ANALYZER |\n| myIndex | data_types | ARRAY\u003cSTRING\u003e | [\"STRING\"] |\n+------------+------------------+---------------+----------------+\n```"]]