{"Entry":{"collection":"sql","key":"create-text-search-dictionary","name":"CREATE TEXT SEARCH DICTIONARY","aliases":["createtsdictionary"],"metadata":{"aliases":["createtsdictionary"],"changed_in":[],"changes":[{"from":"8.2","purpose_changed":false,"renamed":null,"sections":{"added":[],"changed":[],"removed":[]},"status":"added","synopsis":null,"to":"8.3"}],"content_hash":"4fa5c9a802050b7b0c26955fe019b54b6da56cdd3ca7f04580121371027434fd","editorial":{},"first_version":"8.3","group":"textsearch","imported_at":"2026-09-30T17:43:38.590313+08:00","last_version":"20","name":"CREATE TEXT SEARCH DICTIONARY","object":"TEXT SEARCH DICTIONARY","position":8003,"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 dictionary","purpose_zh":"","related":["alter-text-search-dictionary","drop-text-search-dictionary"],"slug":"create-text-search-dictionary","source_rev":"a709ab85","synopsis":"CREATE TEXT SEARCH DICTIONARY name (\nTEMPLATE = template\n[, option = value [, ... ]]\n)","verb":"CREATE"}},"Definition":{"Collection":"sql","Key":"create-text-search-dictionary","SourceDatabase":"center","Version":"18","SourceTable":"sqlcmd","SourceKey":"create-text-search-dictionary","SourceRevision":"a709ab85","Facts":{"anchor":"SQL-CREATETSDICTIONARY","file":"sql-createtsdictionary.html","lang":"en","name":"CREATE TEXT SEARCH DICTIONARY","purpose":"define a new text search dictionary","purpose_zh":"","related":["alter-text-search-dictionary","drop-text-search-dictionary"],"sections":[{"html":"\u003cp\u003e\u003ccode class=\"command\"\u003eCREATE TEXT SEARCH DICTIONARY\u003c/code\u003e creates a new text search dictionary. A text search dictionary specifies a way of recognizing interesting or uninteresting words for searching. A dictionary depends on a text search template, which specifies the functions that actually perform the work. Typically the dictionary provides some options that control the detailed behavior of the template's functions.\u003c/p\u003e\u003cp\u003eIf a schema name is given then the text search dictionary 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 dictionary 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 dictionary 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\u003etemplate\u003c/code\u003e\u003c/em\u003e\u003c/span\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003eThe name of the text search template that will define the basic behavior of this dictionary.\u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003cem class=\"replaceable\"\u003e\u003ccode\u003eoption\u003c/code\u003e\u003c/em\u003e\u003c/span\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003eThe name of a template-specific option to be set for this dictionary.\u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003cem class=\"replaceable\"\u003e\u003ccode\u003evalue\u003c/code\u003e\u003c/em\u003e\u003c/span\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003eThe value to use for a template-specific option. If the value is not a simple identifier or number, it must be quoted (but you can always quote it, if you wish).\u003c/p\u003e\u003c/dd\u003e\u003c/dl\u003e\u003c/div\u003e\u003cp\u003eThe options can appear in any order.\u003c/p\u003e","key":"parameters","title":"Parameters"},{"html":"\u003cp\u003eThe following example command creates a Snowball-based dictionary with a nonstandard list of stop words.\u003c/p\u003e\u003cpre class=\"programlisting\"\u003eCREATE TEXT SEARCH DICTIONARY my_russian (\n    template = snowball,\n    language = russian,\n    stopwords = myrussian\n);\n\u003c/pre\u003e","key":"examples","title":"Examples"},{"html":"\u003cp\u003eThere is no \u003ccode class=\"command\"\u003eCREATE TEXT SEARCH DICTIONARY\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-dictionary/?v=18\" title=\"ALTER TEXT SEARCH DICTIONARY\"\u003e\u003cspan class=\"refentrytitle\"\u003eALTER TEXT SEARCH DICTIONARY\u003c/span\u003e\u003c/a\u003e, \u003ca href=\"/wiki/sql/drop-text-search-dictionary/?v=18\" title=\"DROP TEXT SEARCH DICTIONARY\"\u003e\u003cspan class=\"refentrytitle\"\u003eDROP TEXT SEARCH DICTIONARY\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 DICTIONARY \u003cem class=\"replaceable\"\u003e\u003ccode\u003ename\u003c/code\u003e\u003c/em\u003e (\n    TEMPLATE = \u003cem class=\"replaceable\"\u003e\u003ccode\u003etemplate\u003c/code\u003e\u003c/em\u003e\n    [, \u003cem class=\"replaceable\"\u003e\u003ccode\u003eoption\u003c/code\u003e\u003c/em\u003e = \u003cem class=\"replaceable\"\u003e\u003ccode\u003evalue\u003c/code\u003e\u003c/em\u003e [, ... ]]\n)","synopsis_text":"CREATE TEXT SEARCH DICTIONARY name (\nTEMPLATE = template\n[, option = value [, ... ]]\n)"},"ManualEvidence":{},"MeasuredEvidence":{}},"Text":{"Collection":"sql","Key":"create-text-search-dictionary","SourceDatabase":"pgweb","Version":"18","Locale":"zh-Hans","Title":"CREATE TEXT SEARCH DICTIONARY","Summary":"定义一个新的文本检索词典","BodyHTML":"\u003cpre\u003eCREATE TEXT SEARCH DICTIONARY name (\nTEMPLATE = template\n[, option = value [, ... ]]\n)\u003c/pre\u003e\u003csection\u003e\u003ch2\u003e描述\u003c/h2\u003e\u003cp\u003e\u003ccode\u003eCREATE TEXT SEARCH DICTIONARY\u003c/code\u003e创建一个新的文本检索词典。文本检索词典指定一种在搜索时识别哪些词值得关注、哪些词不值得关注的方式。词典依赖于文本检索模板，后者规定了实际执行这项工作的函数。通常，词典会提供一些选项，用来控制模板函数的具体行为。\u003c/p\u003e\u003cp\u003e如果给出了一个模式名称，那么该文本检索词典会被创建在指定的模式中。否则它会被创建在当前模式中。\u003c/p\u003e\u003cp\u003e定义文本检索词典的用户将成为其拥有者。\u003c/p\u003e\u003cp\u003e更多信息请参见\u003ca href=\"/docs/18/textsearch.html\" rel=\"nofollow\"\u003e第 12 章\u003c/a\u003e。\u003c/p\u003e\u003c/section\u003e\u003csection\u003e\u003ch2\u003e参数\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\u003e要创建的文本检索词典的名称。该名称可以被模式限定。\u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan\u003e\u003cem\u003e\u003ccode\u003etemplate\u003c/code\u003e\u003c/em\u003e\u003c/span\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003e用于定义该词典基本行为的文本检索模板名称。\u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan\u003e\u003cem\u003e\u003ccode\u003eoption\u003c/code\u003e\u003c/em\u003e\u003c/span\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003e要为此词典设置的模板相关选项的名称。\u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan\u003e\u003cem\u003e\u003ccode\u003evalue\u003c/code\u003e\u003c/em\u003e\u003c/span\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003e模板相关选项要使用的值。如果该值不是简单的标识符或数字，则必须用引号括起（当然，如果你愿意，也始终可以加引号）。\u003c/p\u003e\u003c/dd\u003e\u003c/dl\u003e\u003c/div\u003e\u003cp\u003e这些选项可以按任意顺序出现。\u003c/p\u003e\u003c/section\u003e\u003csection\u003e\u003ch2\u003e示例\u003c/h2\u003e\u003cp\u003e下面的示例命令创建了一个基于 Snowball 且使用非标准停用词列表的词典。\u003c/p\u003e\u003cpre\u003eCREATE TEXT SEARCH DICTIONARY my_russian (\n    template = snowball,\n    language = russian,\n    stopwords = myrussian\n);\n\u003c/pre\u003e\u003c/section\u003e\u003csection\u003e\u003ch2\u003e兼容性\u003c/h2\u003e\u003cp\u003e在 SQL 标准中没有 \u003ccode\u003eCREATE TEXT SEARCH DICTIONARY\u003c/code\u003e语句。\u003c/p\u003e\u003c/section\u003e\u003csection\u003e\u003ch2\u003e另见\u003c/h2\u003e\u003cspan\u003e\u003ca href=\"/wiki/sql/alter-text-search-dictionary/?v=18\" title=\"ALTER TEXT SEARCH DICTIONARY\" rel=\"nofollow\"\u003e\u003cspan\u003eALTER TEXT SEARCH DICTIONARY\u003c/span\u003e\u003c/a\u003e, \u003ca href=\"/wiki/sql/drop-text-search-dictionary/?v=18\" title=\"DROP TEXT SEARCH DICTIONARY\" rel=\"nofollow\"\u003e\u003cspan\u003eDROP TEXT SEARCH DICTIONARY\u003c/span\u003e\u003c/a\u003e\u003c/span\u003e\u003c/section\u003e","SourceRevision":"1b5ca64c","ContentHash":"4d64f1e1977653fde2022ce34c0feeace72829a0468a376f2a799025213bcfe3","Payload":{"purpose_zh":"定义一个新的文本检索词典","sections":[{"html":"\u003cp\u003e\u003ccode class=\"command\"\u003eCREATE TEXT SEARCH DICTIONARY\u003c/code\u003e创建一个新的文本检索词典。文本检索词典指定一种在搜索时识别哪些词值得关注、哪些词不值得关注的方式。词典依赖于文本检索模板，后者规定了实际执行这项工作的函数。通常，词典会提供一些选项，用来控制模板函数的具体行为。\u003c/p\u003e\u003cp\u003e如果给出了一个模式名称，那么该文本检索词典会被创建在指定的模式中。否则它会被创建在当前模式中。\u003c/p\u003e\u003cp\u003e定义文本检索词典的用户将成为其拥有者。\u003c/p\u003e\u003cp\u003e更多信息请参见\u003ca href=\"/docs/18/textsearch.html\" title=\"第 12 章 全文检索\"\u003e第 12 章\u003c/a\u003e。\u003c/p\u003e","key":"description","title":"描述"},{"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\u003e要创建的文本检索词典的名称。该名称可以被模式限定。\u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003cem class=\"replaceable\"\u003e\u003ccode\u003etemplate\u003c/code\u003e\u003c/em\u003e\u003c/span\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003e用于定义该词典基本行为的文本检索模板名称。\u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003cem class=\"replaceable\"\u003e\u003ccode\u003eoption\u003c/code\u003e\u003c/em\u003e\u003c/span\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003e要为此词典设置的模板相关选项的名称。\u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003cem class=\"replaceable\"\u003e\u003ccode\u003evalue\u003c/code\u003e\u003c/em\u003e\u003c/span\u003e\u003c/dt\u003e\u003cdd\u003e\u003cp\u003e模板相关选项要使用的值。如果该值不是简单的标识符或数字，则必须用引号括起（当然，如果你愿意，也始终可以加引号）。\u003c/p\u003e\u003c/dd\u003e\u003c/dl\u003e\u003c/div\u003e\u003cp\u003e这些选项可以按任意顺序出现。\u003c/p\u003e","key":"parameters","title":"参数"},{"html":"\u003cp\u003e下面的示例命令创建了一个基于 Snowball 且使用非标准停用词列表的词典。\u003c/p\u003e\u003cpre class=\"programlisting\"\u003eCREATE TEXT SEARCH DICTIONARY my_russian (\n    template = snowball,\n    language = russian,\n    stopwords = myrussian\n);\n\u003c/pre\u003e","key":"examples","title":"示例"},{"html":"\u003cp\u003e在 SQL 标准中没有 \u003ccode class=\"command\"\u003eCREATE TEXT SEARCH DICTIONARY\u003c/code\u003e语句。\u003c/p\u003e","key":"compatibility","title":"兼容性"},{"html":"\u003cspan class=\"simplelist\"\u003e\u003ca href=\"/wiki/sql/alter-text-search-dictionary/?v=18\" title=\"ALTER TEXT SEARCH DICTIONARY\"\u003e\u003cspan class=\"refentrytitle\"\u003eALTER TEXT SEARCH DICTIONARY\u003c/span\u003e\u003c/a\u003e, \u003ca href=\"/wiki/sql/drop-text-search-dictionary/?v=18\" title=\"DROP TEXT SEARCH DICTIONARY\"\u003e\u003cspan class=\"refentrytitle\"\u003eDROP TEXT SEARCH DICTIONARY\u003c/span\u003e\u003c/a\u003e\u003c/span\u003e","key":"see_also","title":"另见"}],"sections_same_as":"","synopsis_html":"CREATE TEXT SEARCH DICTIONARY \u003cem class=\"replaceable\"\u003e\u003ccode\u003ename\u003c/code\u003e\u003c/em\u003e (\n    TEMPLATE = \u003cem class=\"replaceable\"\u003e\u003ccode\u003etemplate\u003c/code\u003e\u003c/em\u003e\n    [, \u003cem class=\"replaceable\"\u003e\u003ccode\u003eoption\u003c/code\u003e\u003c/em\u003e = \u003cem class=\"replaceable\"\u003e\u003ccode\u003evalue\u003c/code\u003e\u003c/em\u003e [, ... ]]\n)","synopsis_text":"CREATE TEXT SEARCH DICTIONARY name (\nTEMPLATE = template\n[, option = value [, ... ]]\n)"}},"RequestedLocale":"zh-Hans","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}
