{"Entry":{"collection":"sql","key":"create-text-search-configuration","name":"CREATE TEXT SEARCH CONFIGURATION","aliases":["createtsconfig"],"metadata":{"aliases":["createtsconfig"],"changed_in":[],"changes":[{"from":"8.2","purpose_changed":false,"renamed":null,"sections":{"added":[],"changed":[],"removed":[]},"status":"added","synopsis":null,"to":"8.3"}],"content_hash":"9999be376e8bf1f0479bfcd866589cc450cf023960fa3f764cae07979bd19ab2","derived_content_hash":"f50a65ab44a317d7aab345d182c4339b4739c7457ebb0780e4abb3b7e92a337a","editorial":{},"first_version":"8.3","group":"textsearch","imported_at":"2026-09-30T17:43:38.566066+08:00","last_version":"20","name":"CREATE TEXT SEARCH CONFIGURATION","object":"TEXT SEARCH CONFIGURATION","position":8000,"present_in":["8.3","8.4","9.0","9.1","9.2","9.3","9.4","9.5","9.6","10","11","12","13","14","15","16","17","18","19","20"],"purpose":"define a new text search configuration","purpose_zh":"","related":["alter-text-search-configuration","drop-text-search-configuration"],"repair_provenance":{"original_source_revision":"wiki-repair-20261023:9ab61d679bbfb47e5e0070915673189ba69877f5d44107ef73e69e14296a93d4","receipt_sha256":"dbc87fd67bc98ebaf299c35877a9f95d1df75d2d88c7ca816d71a15d88dc9233","repair":"wiki-repair-20261023"},"slug":"create-text-search-configuration","source_rev":"wiki-repair-20261023:f57b08e7bf29504c8eeb5dcb2b98f9fd7ca3d43874e4628ce95e22486a4c5bd6","synopsis":"CREATE TEXT SEARCH CONFIGURATION name (\nPARSER = parser_name |\nCOPY = source_config\n)","verb":"CREATE"}},"Definition":{"Collection":"sql","Key":"create-text-search-configuration","SourceDatabase":"center","Version":"18","SourceTable":"sqlcmd","SourceKey":"create-text-search-configuration","SourceRevision":"wiki-repair-20261023:f57b08e7bf29504c8eeb5dcb2b98f9fd7ca3d43874e4628ce95e22486a4c5bd6","Facts":{"anchor":"SQL-CREATETSCONFIG","description_zh":"定义一个新的文本检索配置","description_zh_html":"\u003cpre\u003eCREATE TEXT SEARCH CONFIGURATION name (\nPARSER = parser_name |\nCOPY = source_config\n)\u003c/pre\u003e\u003csection\u003e\u003ch2\u003e描述\u003c/h2\u003e\u003cp\u003e\n\u003ccode class=\"command\"\u003eCREATE TEXT SEARCH CONFIGURATION\u003c/code\u003e\n   创建一个新的文本检索配置。文本检索配置指定一个能把字符串拆分为词元的文本检索解析器，以及一些可用于判断哪些词元对搜索有意义的词典。\n  \u003c/p\u003e\u003cp\u003e\n   如果只指定了解析器，那么新文本检索配置最初没有从词元类型到词典的映射，因而会忽略所有词。要让该配置真正可用，必须使用后续的 \u003ccode class=\"command\"\u003eALTER TEXT SEARCH\n   CONFIGURATION\u003c/code\u003e 命令创建映射。另一种方式是复制一个现有的文本检索配置。\n  \u003c/p\u003e\u003cp\u003e\n   如果给出了一个模式名称，则文本检索配置会被创建在指定的模式中。否则它将会被创建在当前模式中。\n  \u003c/p\u003e\u003cp\u003e\n   定义该文本检索配置的用户会成为其拥有者。\n  \u003c/p\u003e\u003cp\u003e\n   更多信息请参见\u003ca class=\"xref\" href=\"/zh/docs/18/textsearch.html\" title=\"第 12 章 全文检索\"\u003e第 12 章\u003c/a\u003e。\n  \u003c/p\u003e\u003c/section\u003e\u003csection\u003e\u003ch2\u003e参数\u003c/h2\u003e\u003cdiv class=\"variablelist\"\u003e\u003cdl class=\"variablelist\"\u003e\u003cdt id=\"ZH18-AUTO-CREATE_TSCONFIG-VARLISTENTRY-1\"\u003e\u003cspan class=\"term\"\u003e\u003cem class=\"replaceable\"\u003e\u003ccode\u003ename\u003c/code\u003e\u003c/em\u003e\u003c/span\u003e \u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n      要创建的文本检索配置的名称。该名称可以是模式限定的。\n     \u003c/p\u003e\u003c/dd\u003e\u003cdt id=\"ZH18-AUTO-CREATE_TSCONFIG-VARLISTENTRY-2\"\u003e\u003cspan class=\"term\"\u003e\u003cem class=\"replaceable\"\u003e\u003ccode\u003eparser_name\u003c/code\u003e\u003c/em\u003e\u003c/span\u003e \u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n      此配置要使用的文本检索解析器的名称。\n     \u003c/p\u003e\u003c/dd\u003e\u003cdt id=\"ZH18-AUTO-CREATE_TSCONFIG-VARLISTENTRY-3\"\u003e\u003cspan class=\"term\"\u003e\u003cem class=\"replaceable\"\u003e\u003ccode\u003esource_config\u003c/code\u003e\u003c/em\u003e\u003c/span\u003e \u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n      要复制的现有文本检索配置的名称。\n     \u003c/p\u003e\u003c/dd\u003e\u003c/dl\u003e\u003c/div\u003e\u003c/section\u003e\u003csection\u003e\u003ch2\u003e注解\u003c/h2\u003e\u003cp\u003e\n\u003ccode class=\"literal\"\u003ePARSER\u003c/code\u003e 和 \u003ccode class=\"literal\"\u003eCOPY\u003c/code\u003e 选项是互斥的，因为当一个已有的配置被复制时，它的解析器选择也会一并被复制。\n  \u003c/p\u003e\u003c/section\u003e\u003csection\u003e\u003ch2\u003e兼容性\u003c/h2\u003e\u003cp\u003e\n   在 SQL 标准中没有\n   \u003ccode class=\"command\"\u003eCREATE TEXT SEARCH CONFIGURATION\u003c/code\u003e 语句。\n  \u003c/p\u003e\u003c/section\u003e\u003csection\u003e\u003ch2\u003e另见\u003c/h2\u003e\u003cspan class=\"simplelist\"\u003e\u003ca class=\"xref\" href=\"/zh/docs/18/sql-altertsconfig.html\" title=\"ALTER TEXT SEARCH CONFIGURATION\"\u003e\u003cspan class=\"refentrytitle\"\u003eALTER TEXT SEARCH CONFIGURATION\u003c/span\u003e\u003c/a\u003e, \u003ca class=\"xref\" href=\"/zh/docs/18/sql-droptsconfig.html\" title=\"DROP TEXT SEARCH CONFIGURATION\"\u003e\u003cspan class=\"refentrytitle\"\u003eDROP TEXT SEARCH CONFIGURATION\u003c/span\u003e\u003c/a\u003e\u003c/span\u003e\u003c/section\u003e","file":"sql-createtsconfig.html","lang":"en","name":"CREATE TEXT SEARCH CONFIGURATION","purpose":"define a new text search configuration","purpose_zh":"定义一个新的文本检索配置","related":["alter-text-search-configuration","drop-text-search-configuration"],"sections":[{"html":"\u003cp\u003e\u003ccode class=\"command\"\u003eCREATE TEXT SEARCH CONFIGURATION\u003c/code\u003e creates a new text search configuration. A text search configuration specifies a text search parser that can divide a string into tokens, plus dictionaries that can be used to determine which tokens are of interest for searching.\u003c/p\u003e\u003cp\u003eIf only the parser is specified, then the new text search configuration initially has no mappings from token types to dictionaries, and therefore will ignore all words. Subsequent \u003ccode class=\"command\"\u003eALTER TEXT SEARCH CONFIGURATION\u003c/code\u003e commands must be used to create mappings to make the configuration useful. Alternatively, an existing text search configuration can be copied.\u003c/p\u003e\u003cp\u003eIf a schema name is given then the text search configuration is created in the specified schema. Otherwise it is created in the current schema.\u003c/p\u003e\u003cp\u003eThe user who defines a text search configuration becomes its owner.\u003c/p\u003e\u003cp\u003eRefer to \u003ca href=\"/docs/18/textsearch.html\" title=\"Chapter 12. Full Text Search\"\u003eChapter 12\u003c/a\u003e for further information.\u003c/p\u003e","key":"description","title":"Description"},{"html":"\u003cdiv class=\"variablelist\"\u003e\u003cdl class=\"variablelist\"\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003cem class=\"replaceable\"\u003e\u003ccode\u003ename\u003c/code\u003e\u003c/em\u003e\u003c/span\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003eThe name of the text search configuration to be created. The name can be schema-qualified.\u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003cem class=\"replaceable\"\u003e\u003ccode\u003eparser_name\u003c/code\u003e\u003c/em\u003e\u003c/span\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003eThe name of the text search parser to use for this configuration.\u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003cem class=\"replaceable\"\u003e\u003ccode\u003esource_config\u003c/code\u003e\u003c/em\u003e\u003c/span\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003eThe name of an existing text search configuration to copy.\u003c/p\u003e\u003c/dd\u003e\u003c/dl\u003e\u003c/div\u003e","key":"parameters","title":"Parameters"},{"html":"\u003cp\u003eThe \u003ccode class=\"literal\"\u003ePARSER\u003c/code\u003e and \u003ccode class=\"literal\"\u003eCOPY\u003c/code\u003e options are mutually exclusive, because when an existing configuration is copied, its parser selection is copied too.\u003c/p\u003e","key":"notes","title":"Notes"},{"html":"\u003cp\u003eThere is no \u003ccode class=\"command\"\u003eCREATE TEXT SEARCH CONFIGURATION\u003c/code\u003e statement in the SQL standard.\u003c/p\u003e","key":"compatibility","title":"Compatibility"},{"html":"\u003cspan class=\"simplelist\"\u003e\u003ca href=\"/wiki/sql/alter-text-search-configuration/?v=18\" title=\"ALTER TEXT SEARCH CONFIGURATION\"\u003e\u003cspan class=\"refentrytitle\"\u003eALTER TEXT SEARCH CONFIGURATION\u003c/span\u003e\u003c/a\u003e, \u003ca href=\"/wiki/sql/drop-text-search-configuration/?v=18\" title=\"DROP TEXT SEARCH CONFIGURATION\"\u003e\u003cspan class=\"refentrytitle\"\u003eDROP TEXT SEARCH CONFIGURATION\u003c/span\u003e\u003c/a\u003e\u003c/span\u003e","key":"see_also","title":"See Also"}],"sections_same_as":"","slug":"18","synopsis_html":"CREATE TEXT SEARCH CONFIGURATION \u003cem class=\"replaceable\"\u003e\u003ccode\u003ename\u003c/code\u003e\u003c/em\u003e (\n    PARSER = \u003cem class=\"replaceable\"\u003e\u003ccode\u003eparser_name\u003c/code\u003e\u003c/em\u003e |\n    COPY = \u003cem class=\"replaceable\"\u003e\u003ccode\u003esource_config\u003c/code\u003e\u003c/em\u003e\n)","synopsis_text":"CREATE TEXT SEARCH CONFIGURATION name (\nPARSER = parser_name |\nCOPY = source_config\n)","translation_provenance":{"inputs":[{"kind":"current-pgdoc-translation","path":"/Users/vonng/pgsty/pgdoc/zh/18/html/sql-createtsconfig.html","sha256":"7b2343fa6eb7fee800f8bd7ffc097ff6fb27c8f23d96e092abfd0519aa1b10fa"}],"kind":"same-version-pgdoc","locale":"zh-Hans","source_revision":"b1b500221dbe5437cfca004d6b04d3f6e422765d","version":"18"},"zh_from":"same-version-pgdoc"},"ManualEvidence":{},"MeasuredEvidence":{}},"Text":{"Collection":"sql","Key":"create-text-search-configuration","SourceDatabase":"center","Version":"18","Locale":"en","Title":"CREATE TEXT SEARCH CONFIGURATION","Summary":"define a new text search configuration","BodyHTML":"\u003cpre\u003eCREATE TEXT SEARCH CONFIGURATION name (\nPARSER = parser_name |\nCOPY = source_config\n)\u003c/pre\u003e\u003csection\u003e\u003ch2\u003eDescription\u003c/h2\u003e\u003cp\u003e\u003ccode\u003eCREATE TEXT SEARCH CONFIGURATION\u003c/code\u003e creates a new text search configuration. A text search configuration specifies a text search parser that can divide a string into tokens, plus dictionaries that can be used to determine which tokens are of interest for searching.\u003c/p\u003e\u003cp\u003eIf only the parser is specified, then the new text search configuration initially has no mappings from token types to dictionaries, and therefore will ignore all words. Subsequent \u003ccode\u003eALTER TEXT SEARCH CONFIGURATION\u003c/code\u003e commands must be used to create mappings to make the configuration useful. Alternatively, an existing text search configuration can be copied.\u003c/p\u003e\u003cp\u003eIf a schema name is given then the text search configuration is created in the specified schema. Otherwise it is created in the current schema.\u003c/p\u003e\u003cp\u003eThe user who defines a text search configuration becomes its owner.\u003c/p\u003e\u003cp\u003eRefer to \u003ca href=\"/docs/18/textsearch.html\" rel=\"nofollow\"\u003eChapter 12\u003c/a\u003e for further information.\u003c/p\u003e\u003c/section\u003e\u003csection\u003e\u003ch2\u003eParameters\u003c/h2\u003e\u003cdiv\u003e\u003cdl\u003e\u003cdt\u003e\u003cspan\u003e\u003cem\u003e\u003ccode\u003ename\u003c/code\u003e\u003c/em\u003e\u003c/span\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003eThe name of the text search configuration to be created. The name can be schema-qualified.\u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan\u003e\u003cem\u003e\u003ccode\u003eparser_name\u003c/code\u003e\u003c/em\u003e\u003c/span\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003eThe name of the text search parser to use for this configuration.\u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan\u003e\u003cem\u003e\u003ccode\u003esource_config\u003c/code\u003e\u003c/em\u003e\u003c/span\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003eThe name of an existing text search configuration to copy.\u003c/p\u003e\u003c/dd\u003e\u003c/dl\u003e\u003c/div\u003e\u003c/section\u003e\u003csection\u003e\u003ch2\u003eNotes\u003c/h2\u003e\u003cp\u003eThe \u003ccode\u003ePARSER\u003c/code\u003e and \u003ccode\u003eCOPY\u003c/code\u003e options are mutually exclusive, because when an existing configuration is copied, its parser selection is copied too.\u003c/p\u003e\u003c/section\u003e\u003csection\u003e\u003ch2\u003eCompatibility\u003c/h2\u003e\u003cp\u003eThere is no \u003ccode\u003eCREATE TEXT SEARCH CONFIGURATION\u003c/code\u003e statement in the SQL standard.\u003c/p\u003e\u003c/section\u003e\u003csection\u003e\u003ch2\u003eSee Also\u003c/h2\u003e\u003cspan\u003e\u003ca href=\"/wiki/sql/alter-text-search-configuration/?v=18\" title=\"ALTER TEXT SEARCH CONFIGURATION\" rel=\"nofollow\"\u003e\u003cspan\u003eALTER TEXT SEARCH CONFIGURATION\u003c/span\u003e\u003c/a\u003e, \u003ca href=\"/wiki/sql/drop-text-search-configuration/?v=18\" title=\"DROP TEXT SEARCH CONFIGURATION\" rel=\"nofollow\"\u003e\u003cspan\u003eDROP TEXT SEARCH CONFIGURATION\u003c/span\u003e\u003c/a\u003e\u003c/span\u003e\u003c/section\u003e","SourceRevision":"wiki-repair-20261023:f57b08e7bf29504c8eeb5dcb2b98f9fd7ca3d43874e4628ce95e22486a4c5bd6","ContentHash":"5edc9d54850cb12ca4596b0e829a47671597b0e8b8a0c4aefb348626b9c2777a","Payload":{"related":["alter-text-search-configuration","drop-text-search-configuration"],"sections":[{"html":"\u003cp\u003e\u003ccode class=\"command\"\u003eCREATE TEXT SEARCH CONFIGURATION\u003c/code\u003e creates a new text search configuration. A text search configuration specifies a text search parser that can divide a string into tokens, plus dictionaries that can be used to determine which tokens are of interest for searching.\u003c/p\u003e\u003cp\u003eIf only the parser is specified, then the new text search configuration initially has no mappings from token types to dictionaries, and therefore will ignore all words. Subsequent \u003ccode class=\"command\"\u003eALTER TEXT SEARCH CONFIGURATION\u003c/code\u003e commands must be used to create mappings to make the configuration useful. Alternatively, an existing text search configuration can be copied.\u003c/p\u003e\u003cp\u003eIf a schema name is given then the text search configuration is created in the specified schema. Otherwise it is created in the current schema.\u003c/p\u003e\u003cp\u003eThe user who defines a text search configuration becomes its owner.\u003c/p\u003e\u003cp\u003eRefer to \u003ca href=\"/docs/18/textsearch.html\" title=\"Chapter 12. Full Text Search\"\u003eChapter 12\u003c/a\u003e for further information.\u003c/p\u003e","key":"description","title":"Description"},{"html":"\u003cdiv class=\"variablelist\"\u003e\u003cdl class=\"variablelist\"\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003cem class=\"replaceable\"\u003e\u003ccode\u003ename\u003c/code\u003e\u003c/em\u003e\u003c/span\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003eThe name of the text search configuration to be created. The name can be schema-qualified.\u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003cem class=\"replaceable\"\u003e\u003ccode\u003eparser_name\u003c/code\u003e\u003c/em\u003e\u003c/span\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003eThe name of the text search parser to use for this configuration.\u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003cem class=\"replaceable\"\u003e\u003ccode\u003esource_config\u003c/code\u003e\u003c/em\u003e\u003c/span\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003eThe name of an existing text search configuration to copy.\u003c/p\u003e\u003c/dd\u003e\u003c/dl\u003e\u003c/div\u003e","key":"parameters","title":"Parameters"},{"html":"\u003cp\u003eThe \u003ccode class=\"literal\"\u003ePARSER\u003c/code\u003e and \u003ccode class=\"literal\"\u003eCOPY\u003c/code\u003e options are mutually exclusive, because when an existing configuration is copied, its parser selection is copied too.\u003c/p\u003e","key":"notes","title":"Notes"},{"html":"\u003cp\u003eThere is no \u003ccode class=\"command\"\u003eCREATE TEXT SEARCH CONFIGURATION\u003c/code\u003e statement in the SQL standard.\u003c/p\u003e","key":"compatibility","title":"Compatibility"},{"html":"\u003cspan class=\"simplelist\"\u003e\u003ca href=\"/wiki/sql/alter-text-search-configuration/?v=18\" title=\"ALTER TEXT SEARCH CONFIGURATION\"\u003e\u003cspan class=\"refentrytitle\"\u003eALTER TEXT SEARCH CONFIGURATION\u003c/span\u003e\u003c/a\u003e, \u003ca href=\"/wiki/sql/drop-text-search-configuration/?v=18\" title=\"DROP TEXT SEARCH CONFIGURATION\"\u003e\u003cspan class=\"refentrytitle\"\u003eDROP TEXT SEARCH CONFIGURATION\u003c/span\u003e\u003c/a\u003e\u003c/span\u003e","key":"see_also","title":"See Also"}],"sections_same_as":"","synopsis_html":"CREATE TEXT SEARCH CONFIGURATION \u003cem class=\"replaceable\"\u003e\u003ccode\u003ename\u003c/code\u003e\u003c/em\u003e (\n    PARSER = \u003cem class=\"replaceable\"\u003e\u003ccode\u003eparser_name\u003c/code\u003e\u003c/em\u003e |\n    COPY = \u003cem class=\"replaceable\"\u003e\u003ccode\u003esource_config\u003c/code\u003e\u003c/em\u003e\n)","synopsis_text":"CREATE TEXT SEARCH CONFIGURATION name (\nPARSER = parser_name |\nCOPY = source_config\n)"}},"RequestedLocale":"en","Fallback":false,"Versions":["10","11","12","13","14","15","16","17","18","19","20","8.3","8.4","9.0","9.1","9.2","9.3","9.4","9.5","9.6"],"Locales":["en","zh-Hans"],"Signatures":null,"Spellings":null,"SQLState":null,"Evidence":null}
