{"Entry":{"collection":"func","key":"to-tsvector","name":"to_tsvector","aliases":[],"metadata":{"changed_in":["10"],"changes":[{"descriptions_changed":false,"doc_overhaul":false,"from":"8.2","group_changed":null,"signatures":{"added":[],"removed":[]},"status":"added","to":"8.3"},{"descriptions_changed":false,"doc_overhaul":false,"from":"9.6","group_changed":null,"signatures":{"added":["to_tsvector ( [ config regconfig , ] document json(b) ) → tsvector"],"removed":[]},"status":"changed","to":"10"},{"descriptions_changed":false,"doc_overhaul":true,"from":"12","group_changed":null,"signatures":{"added":[],"removed":[]},"status":"changed","to":"13"}],"content_hash":"0245500adb6fd5487c3946826e08edf6ba94d1a0e5e26477fe0c0e2c7f3162a1","first_version":"8.3","group":"textsearch","group_label":"Text Search Functions And Operators","groups":["textsearch"],"imported_at":"2026-09-27T17:57:28.713322+08:00","last_version":"20","name":"to_tsvector","name_key":"to_tsvector","position":12011,"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"],"signature":"to_tsvector ( [ config regconfig, ] document text ) → tsvector","signature_count":3,"slug":"to-tsvector","source_rev":"b7bd9cda","summary":"Converts text to a tsvector, normalizing words according to the specified or default configuration.","summary_zh":""}},"Definition":{"Collection":"func","Key":"to-tsvector","SourceDatabase":"center","Version":"18","SourceTable":"func","SourceKey":"to-tsvector","SourceRevision":"b7bd9cda","Facts":{"description":"Converts text to a tsvector, normalizing words according to the specified or default configuration. Position information is included in the result.","description_html":"Converts text to a \u003ccode class=\"type\"\u003etsvector\u003c/code\u003e, normalizing words according to the specified or default configuration. Position information is included in the result.","description_zh":"","description_zh_html":"","doc":{"anchor":"TEXTSEARCH-FUNCTIONS-TABLE","file":"functions-textsearch.html","slug":"18"},"group":"textsearch","group_label":"Text Search Functions And Operators","lang":"en","layout":"table-new","pages":["functions-textsearch.html"],"prose_only":false,"signatures":[{"description":"Converts text to a tsvector, normalizing words according to the specified or default configuration. Position information is included in the result.","description_html":"Converts text to a \u003ccode class=\"type\"\u003etsvector\u003c/code\u003e, normalizing words according to the specified or default configuration. Position information is included in the result.","description_zh":"","description_zh_html":"","examples":[{"expr":"to_tsvector('english', 'The Fat Rats')","result":"'fat':2 'rat':3"}],"html":"\u003ccode class=\"function\"\u003eto_tsvector\u003c/code\u003e ( [ \u003cspan class=\"optional\"\u003e\u003cem class=\"parameter\"\u003e\u003ccode\u003econfig\u003c/code\u003e\u003c/em\u003e \u003ccode class=\"type\"\u003eregconfig\u003c/code\u003e,\u003c/span\u003e ] \u003cem class=\"parameter\"\u003e\u003ccode\u003edocument\u003c/code\u003e\u003c/em\u003e \u003ccode class=\"type\"\u003etext\u003c/code\u003e ) → \u003ccode class=\"returnvalue\"\u003etsvector\u003c/code\u003e","returns":"tsvector","text":"to_tsvector ( [ config regconfig, ] document text ) → tsvector","zh_from":""},{"description":"Converts each string value in the JSON document to a tsvector, normalizing words according to the specified or default configuration. The results are then concatenated in document order to produce the output. Position information is generated as though one stopword exists between each pair of string values. (Beware that “document order” of the fields of a JSON object is implementation-dependent when the input is jsonb; observe the difference in the examples.)","description_html":"Converts each string value in the JSON document to a \u003ccode class=\"type\"\u003etsvector\u003c/code\u003e, normalizing words according to the specified or default configuration. The results are then concatenated in document order to produce the output. Position information is generated as though one stopword exists between each pair of string values. (Beware that \u003cspan class=\"quote\"\u003e“\u003cspan class=\"quote\"\u003edocument order\u003c/span\u003e”\u003c/span\u003e of the fields of a JSON object is implementation-dependent when the input is \u003ccode class=\"type\"\u003ejsonb\u003c/code\u003e; observe the difference in the examples.)","description_zh":"","description_zh_html":"","examples":[{"expr":"to_tsvector('english', '{\"aa\": \"The Fat Rats\", \"b\": \"dog\"}'::json)","result":"'dog':5 'fat':2 'rat':3"},{"expr":"to_tsvector('english', '{\"aa\": \"The Fat Rats\", \"b\": \"dog\"}'::jsonb)","result":"'dog':1 'fat':4 'rat':5"}],"html":"\u003ccode class=\"function\"\u003eto_tsvector\u003c/code\u003e ( [ \u003cspan class=\"optional\"\u003e\u003cem class=\"parameter\"\u003e\u003ccode\u003econfig\u003c/code\u003e\u003c/em\u003e \u003ccode class=\"type\"\u003eregconfig\u003c/code\u003e,\u003c/span\u003e ] \u003cem class=\"parameter\"\u003e\u003ccode\u003edocument\u003c/code\u003e\u003c/em\u003e \u003ccode class=\"type\"\u003ejson\u003c/code\u003e ) → \u003ccode class=\"returnvalue\"\u003etsvector\u003c/code\u003e","returns":"tsvector","text":"to_tsvector ( [ config regconfig, ] document json ) → tsvector","zh_from":""},{"description":"Converts each string value in the JSON document to a tsvector, normalizing words according to the specified or default configuration. The results are then concatenated in document order to produce the output. Position information is generated as though one stopword exists between each pair of string values. (Beware that “document order” of the fields of a JSON object is implementation-dependent when the input is jsonb; observe the difference in the examples.)","description_html":"Converts each string value in the JSON document to a \u003ccode class=\"type\"\u003etsvector\u003c/code\u003e, normalizing words according to the specified or default configuration. The results are then concatenated in document order to produce the output. Position information is generated as though one stopword exists between each pair of string values. (Beware that \u003cspan class=\"quote\"\u003e“\u003cspan class=\"quote\"\u003edocument order\u003c/span\u003e”\u003c/span\u003e of the fields of a JSON object is implementation-dependent when the input is \u003ccode class=\"type\"\u003ejsonb\u003c/code\u003e; observe the difference in the examples.)","description_zh":"","description_zh_html":"","examples":[{"expr":"to_tsvector('english', '{\"aa\": \"The Fat Rats\", \"b\": \"dog\"}'::json)","result":"'dog':5 'fat':2 'rat':3"},{"expr":"to_tsvector('english', '{\"aa\": \"The Fat Rats\", \"b\": \"dog\"}'::jsonb)","result":"'dog':1 'fat':4 'rat':5"}],"html":"\u003ccode class=\"function\"\u003eto_tsvector\u003c/code\u003e ( [ \u003cspan class=\"optional\"\u003e\u003cem class=\"parameter\"\u003e\u003ccode\u003econfig\u003c/code\u003e\u003c/em\u003e \u003ccode class=\"type\"\u003eregconfig\u003c/code\u003e,\u003c/span\u003e ] \u003cem class=\"parameter\"\u003e\u003ccode\u003edocument\u003c/code\u003e\u003c/em\u003e \u003ccode class=\"type\"\u003ejsonb\u003c/code\u003e ) → \u003ccode class=\"returnvalue\"\u003etsvector\u003c/code\u003e","returns":"tsvector","text":"to_tsvector ( [ config regconfig, ] document jsonb ) → tsvector","zh_from":""}],"zh_from":""},"ManualEvidence":{"doc":{"anchor":"TEXTSEARCH-FUNCTIONS-TABLE","file":"functions-textsearch.html","slug":"18"}},"MeasuredEvidence":{}},"Text":{"Collection":"func","Key":"to-tsvector","SourceDatabase":"pgweb","Version":"18","Locale":"zh-Hans","Title":"to_tsvector","Summary":"将文本转换为tsvector，根据指定的或默认配置对单词进行正规化。结果中包含位置信息。","BodyHTML":"将文本转换为\u003ccode\u003etsvector\u003c/code\u003e，根据指定的或默认配置对单词进行正规化。结果中包含位置信息。\u003cpre\u003eto_tsvector ( [ config regconfig, ] document text ) → tsvector\u003c/pre\u003e将文本转换为\u003ccode\u003etsvector\u003c/code\u003e，根据指定的或默认配置对单词进行正规化。结果中包含位置信息。\u003cpre\u003eto_tsvector ( [ config regconfig, ] document json ) → tsvector\u003c/pre\u003e将 JSON 文档中的每个字符串值转换为\u003ccode\u003etsvector\u003c/code\u003e，根据指定的或默认配置对单词进行正规化。然后将结果按文档顺序连接起来以产生输出。生成位置信息时，视为每对字符串值之间存在一个停用词。（注意，当输入为\u003ccode\u003ejsonb\u003c/code\u003e时，JSON 对象字段的\u003cspan\u003e“\u003cspan\u003e文档顺序\u003c/span\u003e”\u003c/span\u003e取决于具体实现；请注意这些示例中的差异。）\u003cpre\u003eto_tsvector ( [ config regconfig, ] document jsonb ) → tsvector\u003c/pre\u003e将 JSON 文档中的每个字符串值转换为\u003ccode\u003etsvector\u003c/code\u003e，根据指定的或默认配置对单词进行正规化。然后将结果按文档顺序连接起来以产生输出。生成位置信息时，视为每对字符串值之间存在一个停用词。（注意，当输入为\u003ccode\u003ejsonb\u003c/code\u003e时，JSON 对象字段的\u003cspan\u003e“\u003cspan\u003e文档顺序\u003c/span\u003e”\u003c/span\u003e取决于具体实现；请注意这些示例中的差异。）","SourceRevision":"1b5ca64c","ContentHash":"95ea6b6036b669ea0c82ae5e882e00383dbac00845e1ede8b31620542718df70","Payload":{"description_zh":"将文本转换为tsvector，根据指定的或默认配置对单词进行正规化。结果中包含位置信息。","description_zh_html":"将文本转换为\u003ccode class=\"type\"\u003etsvector\u003c/code\u003e，根据指定的或默认配置对单词进行正规化。结果中包含位置信息。","signatures":[{"description_zh":"将文本转换为tsvector，根据指定的或默认配置对单词进行正规化。结果中包含位置信息。","description_zh_html":"将文本转换为\u003ccode class=\"type\"\u003etsvector\u003c/code\u003e，根据指定的或默认配置对单词进行正规化。结果中包含位置信息。","returns":"tsvector","text":"to_tsvector ( [ config regconfig, ] document text ) → tsvector","zh_from":"doc"},{"description_zh":"将 JSON 文档中的每个字符串值转换为tsvector，根据指定的或默认配置对单词进行正规化。然后将结果按文档顺序连接起来以产生输出。生成位置信息时，视为每对字符串值之间存在一个停用词。（注意，当输入为jsonb时，JSON 对象字段的“文档顺序”取决于具体实现；请注意这些示例中的差异。）","description_zh_html":"将 JSON 文档中的每个字符串值转换为\u003ccode class=\"type\"\u003etsvector\u003c/code\u003e，根据指定的或默认配置对单词进行正规化。然后将结果按文档顺序连接起来以产生输出。生成位置信息时，视为每对字符串值之间存在一个停用词。（注意，当输入为\u003ccode class=\"type\"\u003ejsonb\u003c/code\u003e时，JSON 对象字段的\u003cspan class=\"quote\"\u003e“\u003cspan class=\"quote\"\u003e文档顺序\u003c/span\u003e”\u003c/span\u003e取决于具体实现；请注意这些示例中的差异。）","returns":"tsvector","text":"to_tsvector ( [ config regconfig, ] document json ) → tsvector","zh_from":"doc"},{"description_zh":"将 JSON 文档中的每个字符串值转换为tsvector，根据指定的或默认配置对单词进行正规化。然后将结果按文档顺序连接起来以产生输出。生成位置信息时，视为每对字符串值之间存在一个停用词。（注意，当输入为jsonb时，JSON 对象字段的“文档顺序”取决于具体实现；请注意这些示例中的差异。）","description_zh_html":"将 JSON 文档中的每个字符串值转换为\u003ccode class=\"type\"\u003etsvector\u003c/code\u003e，根据指定的或默认配置对单词进行正规化。然后将结果按文档顺序连接起来以产生输出。生成位置信息时，视为每对字符串值之间存在一个停用词。（注意，当输入为\u003ccode class=\"type\"\u003ejsonb\u003c/code\u003e时，JSON 对象字段的\u003cspan class=\"quote\"\u003e“\u003cspan class=\"quote\"\u003e文档顺序\u003c/span\u003e”\u003c/span\u003e取决于具体实现；请注意这些示例中的差异。）","returns":"tsvector","text":"to_tsvector ( [ config regconfig, ] document jsonb ) → tsvector","zh_from":"doc"}],"zh_from":"doc"}},"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":[{"Version":"18","Ordinal":0,"Hash":"413a3abba43cb60b54e832a85dc01ae9415ce255d985517df314721af33406d9","Text":"to_tsvector ( [ config regconfig, ] document text ) → tsvector","Returns":"tsvector","Payload":{"description":"Converts text to a tsvector, normalizing words according to the specified or default configuration. Position information is included in the result.","description_html":"Converts text to a \u003ccode class=\"type\"\u003etsvector\u003c/code\u003e, normalizing words according to the specified or default configuration. Position information is included in the result.","description_zh":"","description_zh_html":"","examples":[{"expr":"to_tsvector('english', 'The Fat Rats')","result":"'fat':2 'rat':3"}],"html":"\u003ccode class=\"function\"\u003eto_tsvector\u003c/code\u003e ( [ \u003cspan class=\"optional\"\u003e\u003cem class=\"parameter\"\u003e\u003ccode\u003econfig\u003c/code\u003e\u003c/em\u003e \u003ccode class=\"type\"\u003eregconfig\u003c/code\u003e,\u003c/span\u003e ] \u003cem class=\"parameter\"\u003e\u003ccode\u003edocument\u003c/code\u003e\u003c/em\u003e \u003ccode class=\"type\"\u003etext\u003c/code\u003e ) → \u003ccode class=\"returnvalue\"\u003etsvector\u003c/code\u003e","returns":"tsvector","text":"to_tsvector ( [ config regconfig, ] document text ) → tsvector","zh_from":""}},{"Version":"18","Ordinal":1,"Hash":"ad19504246e17a7e6d4684b739bec65eea83e02639ae24a8cd6f62b061628753","Text":"to_tsvector ( [ config regconfig, ] document json ) → tsvector","Returns":"tsvector","Payload":{"description":"Converts each string value in the JSON document to a tsvector, normalizing words according to the specified or default configuration. The results are then concatenated in document order to produce the output. Position information is generated as though one stopword exists between each pair of string values. (Beware that “document order” of the fields of a JSON object is implementation-dependent when the input is jsonb; observe the difference in the examples.)","description_html":"Converts each string value in the JSON document to a \u003ccode class=\"type\"\u003etsvector\u003c/code\u003e, normalizing words according to the specified or default configuration. The results are then concatenated in document order to produce the output. Position information is generated as though one stopword exists between each pair of string values. (Beware that \u003cspan class=\"quote\"\u003e“\u003cspan class=\"quote\"\u003edocument order\u003c/span\u003e”\u003c/span\u003e of the fields of a JSON object is implementation-dependent when the input is \u003ccode class=\"type\"\u003ejsonb\u003c/code\u003e; observe the difference in the examples.)","description_zh":"","description_zh_html":"","examples":[{"expr":"to_tsvector('english', '{\"aa\": \"The Fat Rats\", \"b\": \"dog\"}'::json)","result":"'dog':5 'fat':2 'rat':3"},{"expr":"to_tsvector('english', '{\"aa\": \"The Fat Rats\", \"b\": \"dog\"}'::jsonb)","result":"'dog':1 'fat':4 'rat':5"}],"html":"\u003ccode class=\"function\"\u003eto_tsvector\u003c/code\u003e ( [ \u003cspan class=\"optional\"\u003e\u003cem class=\"parameter\"\u003e\u003ccode\u003econfig\u003c/code\u003e\u003c/em\u003e \u003ccode class=\"type\"\u003eregconfig\u003c/code\u003e,\u003c/span\u003e ] \u003cem class=\"parameter\"\u003e\u003ccode\u003edocument\u003c/code\u003e\u003c/em\u003e \u003ccode class=\"type\"\u003ejson\u003c/code\u003e ) → \u003ccode class=\"returnvalue\"\u003etsvector\u003c/code\u003e","returns":"tsvector","text":"to_tsvector ( [ config regconfig, ] document json ) → tsvector","zh_from":""}},{"Version":"18","Ordinal":2,"Hash":"eef16b44a93d43a3de573a0383b04ba8ee73db0020a0048682a2d8d3cd7faee6","Text":"to_tsvector ( [ config regconfig, ] document jsonb ) → tsvector","Returns":"tsvector","Payload":{"description":"Converts each string value in the JSON document to a tsvector, normalizing words according to the specified or default configuration. The results are then concatenated in document order to produce the output. Position information is generated as though one stopword exists between each pair of string values. (Beware that “document order” of the fields of a JSON object is implementation-dependent when the input is jsonb; observe the difference in the examples.)","description_html":"Converts each string value in the JSON document to a \u003ccode class=\"type\"\u003etsvector\u003c/code\u003e, normalizing words according to the specified or default configuration. The results are then concatenated in document order to produce the output. Position information is generated as though one stopword exists between each pair of string values. (Beware that \u003cspan class=\"quote\"\u003e“\u003cspan class=\"quote\"\u003edocument order\u003c/span\u003e”\u003c/span\u003e of the fields of a JSON object is implementation-dependent when the input is \u003ccode class=\"type\"\u003ejsonb\u003c/code\u003e; observe the difference in the examples.)","description_zh":"","description_zh_html":"","examples":[{"expr":"to_tsvector('english', '{\"aa\": \"The Fat Rats\", \"b\": \"dog\"}'::json)","result":"'dog':5 'fat':2 'rat':3"},{"expr":"to_tsvector('english', '{\"aa\": \"The Fat Rats\", \"b\": \"dog\"}'::jsonb)","result":"'dog':1 'fat':4 'rat':5"}],"html":"\u003ccode class=\"function\"\u003eto_tsvector\u003c/code\u003e ( [ \u003cspan class=\"optional\"\u003e\u003cem class=\"parameter\"\u003e\u003ccode\u003econfig\u003c/code\u003e\u003c/em\u003e \u003ccode class=\"type\"\u003eregconfig\u003c/code\u003e,\u003c/span\u003e ] \u003cem class=\"parameter\"\u003e\u003ccode\u003edocument\u003c/code\u003e\u003c/em\u003e \u003ccode class=\"type\"\u003ejsonb\u003c/code\u003e ) → \u003ccode class=\"returnvalue\"\u003etsvector\u003c/code\u003e","returns":"tsvector","text":"to_tsvector ( [ config regconfig, ] document jsonb ) → tsvector","zh_from":""}}],"Spellings":null,"SQLState":null,"Evidence":null}
