{"Entry":{"collection":"func","key":"json-to-tsvector","name":"json_to_tsvector","aliases":[],"metadata":{"changed_in":[],"changes":[{"descriptions_changed":false,"doc_overhaul":false,"from":"12","group_changed":null,"signatures":{"added":[],"removed":[]},"status":"added","to":"13"}],"content_hash":"3d126ac087921d9b9ed35a067a4e2cabe4d8f9eb71a1fbdab1b7db09a7af732d","first_version":"13","group":"textsearch","group_label":"Text Search Functions And Operators","groups":["textsearch"],"imported_at":"2026-09-14T21:49:48.736944+08:00","last_version":"20","name":"json_to_tsvector","name_key":"json_to_tsvector","position":12002,"present_in":["13","14","15","16","17","18","19","20"],"signature":"json_to_tsvector ( [ config regconfig, ] document json, filter jsonb ) → tsvector","signature_count":1,"slug":"json-to-tsvector","source_rev":"2026-09-14T13:14:25.684213+00:00@99e6866c","summary":"Selects each item in the JSON document that is requested by the filter and converts each one to a tsvector, normalizing words according to the specified or default configuration.","summary_zh":""}},"Definition":{"Collection":"func","Key":"json-to-tsvector","SourceDatabase":"center","Version":"18","SourceTable":"func","SourceKey":"json-to-tsvector","SourceRevision":"2026-09-14T13:14:25.684213+00:00@99e6866c","Facts":{"description":"Selects each item in the JSON document that is requested by the filter and converts each one 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 selected items. (Beware that “document order” of the fields of a JSON object is implementation-dependent when the input is jsonb.) The filter must be a jsonb array containing zero or more of these keywords: \"string\" (to include all string values), \"numeric\" (to include all numeric values), \"boolean\" (to include all boolean values), \"key\" (to include all keys), or \"all\" (to include all the above). As a special case, the filter can also be a simple JSON value that is one of these keywords.","description_html":"Selects each item in the JSON document that is requested by the \u003cem class=\"parameter\"\u003e\u003ccode\u003efilter\u003c/code\u003e\u003c/em\u003e and converts each one 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 selected items. (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.) The \u003cem class=\"parameter\"\u003e\u003ccode\u003efilter\u003c/code\u003e\u003c/em\u003e must be a \u003ccode class=\"type\"\u003ejsonb\u003c/code\u003e array containing zero or more of these keywords: \u003ccode class=\"literal\"\u003e\"string\"\u003c/code\u003e (to include all string values), \u003ccode class=\"literal\"\u003e\"numeric\"\u003c/code\u003e (to include all numeric values), \u003ccode class=\"literal\"\u003e\"boolean\"\u003c/code\u003e (to include all boolean values), \u003ccode class=\"literal\"\u003e\"key\"\u003c/code\u003e (to include all keys), or \u003ccode class=\"literal\"\u003e\"all\"\u003c/code\u003e (to include all the above). As a special case, the \u003cem class=\"parameter\"\u003e\u003ccode\u003efilter\u003c/code\u003e\u003c/em\u003e can also be a simple JSON value that is one of these keywords.","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":"Selects each item in the JSON document that is requested by the filter and converts each one 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 selected items. (Beware that “document order” of the fields of a JSON object is implementation-dependent when the input is jsonb.) The filter must be a jsonb array containing zero or more of these keywords: \"string\" (to include all string values), \"numeric\" (to include all numeric values), \"boolean\" (to include all boolean values), \"key\" (to include all keys), or \"all\" (to include all the above). As a special case, the filter can also be a simple JSON value that is one of these keywords.","description_html":"Selects each item in the JSON document that is requested by the \u003cem class=\"parameter\"\u003e\u003ccode\u003efilter\u003c/code\u003e\u003c/em\u003e and converts each one 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 selected items. (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.) The \u003cem class=\"parameter\"\u003e\u003ccode\u003efilter\u003c/code\u003e\u003c/em\u003e must be a \u003ccode class=\"type\"\u003ejsonb\u003c/code\u003e array containing zero or more of these keywords: \u003ccode class=\"literal\"\u003e\"string\"\u003c/code\u003e (to include all string values), \u003ccode class=\"literal\"\u003e\"numeric\"\u003c/code\u003e (to include all numeric values), \u003ccode class=\"literal\"\u003e\"boolean\"\u003c/code\u003e (to include all boolean values), \u003ccode class=\"literal\"\u003e\"key\"\u003c/code\u003e (to include all keys), or \u003ccode class=\"literal\"\u003e\"all\"\u003c/code\u003e (to include all the above). As a special case, the \u003cem class=\"parameter\"\u003e\u003ccode\u003efilter\u003c/code\u003e\u003c/em\u003e can also be a simple JSON value that is one of these keywords.","description_zh":"","description_zh_html":"","examples":[{"expr":"json_to_tsvector('english', '{\"a\": \"The Fat Rats\", \"b\": 123}'::json, '[\"string\", \"numeric\"]')","result":"'123':5 'fat':2 'rat':3"},{"expr":"json_to_tsvector('english', '{\"cat\": \"The Fat Rats\", \"dog\": 123}'::json, '\"all\"')","result":"'123':9 'cat':1 'dog':7 'fat':4 'rat':5"}],"html":"\u003ccode class=\"function\"\u003ejson_to_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, \u003cem class=\"parameter\"\u003e\u003ccode\u003efilter\u003c/code\u003e\u003c/em\u003e \u003ccode class=\"type\"\u003ejsonb\u003c/code\u003e ) → \u003ccode class=\"returnvalue\"\u003etsvector\u003c/code\u003e","returns":"tsvector","text":"json_to_tsvector ( [ config regconfig, ] document json, filter jsonb ) → tsvector","zh_from":""}],"zh_from":""},"ManualEvidence":{"doc":{"anchor":"TEXTSEARCH-FUNCTIONS-TABLE","file":"functions-textsearch.html","slug":"18"}},"MeasuredEvidence":{}},"Text":{"Collection":"func","Key":"json-to-tsvector","SourceDatabase":"pgweb","Version":"18","Locale":"zh-Hans","Title":"json_to_tsvector","Summary":"选择filter请求的JSON文档中的每个项，并将每个项转换为tsvector，根据指定的或默认配置对单词进行正规化。然后将结果按文档顺序连接起来以产生输出。位置信息就像在每对选定的项目之间存在一个停用词一样生成。（注意，当输入为jsonb时，JSON对象字段的“文档顺序”取决于实现。）filter必须是一个jsonb数组，其中包含0个或多个关键字：\"string\"（包括所有字符串值），\"numeric\"（包括所有数值），\"boolean\"（包括所有布尔值），\"key\"（包括所有键），或 \"all\"（包括以上所有内容）。作为一种特殊情况，该filter也可以是这些关键字之一的简单JSON值。","BodyHTML":"选择\u003cem\u003e\u003ccode\u003efilter\u003c/code\u003e\u003c/em\u003e请求的JSON文档中的每个项，并将每个项转换为\u003ccode\u003etsvector\u003c/code\u003e，根据指定的或默认配置对单词进行正规化。然后将结果按文档顺序连接起来以产生输出。位置信息就像在每对选定的项目之间存在一个停用词一样生成。（注意，当输入为\u003ccode\u003ejsonb\u003c/code\u003e时，JSON对象字段的\u003cspan\u003e“\u003cspan\u003e文档顺序\u003c/span\u003e”\u003c/span\u003e取决于实现。）\u003cem\u003e\u003ccode\u003efilter\u003c/code\u003e\u003c/em\u003e必须是一个\u003ccode\u003ejsonb\u003c/code\u003e数组，其中包含0个或多个关键字：\u003ccode\u003e\u0026#34;string\u0026#34;\u003c/code\u003e（包括所有字符串值），\u003ccode\u003e\u0026#34;numeric\u0026#34;\u003c/code\u003e（包括所有数值），\u003ccode\u003e\u0026#34;boolean\u0026#34;\u003c/code\u003e（包括所有布尔值），\u003ccode\u003e\u0026#34;key\u0026#34;\u003c/code\u003e（包括所有键），或 \u003ccode\u003e\u0026#34;all\u0026#34;\u003c/code\u003e（包括以上所有内容）。作为一种特殊情况，该\u003cem\u003e\u003ccode\u003efilter\u003c/code\u003e\u003c/em\u003e也可以是这些关键字之一的简单JSON值。\u003cpre\u003ejson_to_tsvector ( [ config regconfig, ] document json, filter jsonb ) → tsvector\u003c/pre\u003e选择\u003cem\u003e\u003ccode\u003efilter\u003c/code\u003e\u003c/em\u003e请求的JSON文档中的每个项，并将每个项转换为\u003ccode\u003etsvector\u003c/code\u003e，根据指定的或默认配置对单词进行正规化。然后将结果按文档顺序连接起来以产生输出。位置信息就像在每对选定的项目之间存在一个停用词一样生成。（注意，当输入为\u003ccode\u003ejsonb\u003c/code\u003e时，JSON对象字段的\u003cspan\u003e“\u003cspan\u003e文档顺序\u003c/span\u003e”\u003c/span\u003e取决于实现。）\u003cem\u003e\u003ccode\u003efilter\u003c/code\u003e\u003c/em\u003e必须是一个\u003ccode\u003ejsonb\u003c/code\u003e数组，其中包含0个或多个关键字：\u003ccode\u003e\u0026#34;string\u0026#34;\u003c/code\u003e（包括所有字符串值），\u003ccode\u003e\u0026#34;numeric\u0026#34;\u003c/code\u003e（包括所有数值），\u003ccode\u003e\u0026#34;boolean\u0026#34;\u003c/code\u003e（包括所有布尔值），\u003ccode\u003e\u0026#34;key\u0026#34;\u003c/code\u003e（包括所有键），或 \u003ccode\u003e\u0026#34;all\u0026#34;\u003c/code\u003e（包括以上所有内容）。作为一种特殊情况，该\u003cem\u003e\u003ccode\u003efilter\u003c/code\u003e\u003c/em\u003e也可以是这些关键字之一的简单JSON值。","SourceRevision":"1b5ca64c","ContentHash":"6b537e4498c633ea501027e684b1c51b40bea114f49f3ce53b0734f1fbb4e95c","Payload":{"description_zh":"选择filter请求的JSON文档中的每个项，并将每个项转换为tsvector，根据指定的或默认配置对单词进行正规化。然后将结果按文档顺序连接起来以产生输出。位置信息就像在每对选定的项目之间存在一个停用词一样生成。（注意，当输入为jsonb时，JSON对象字段的“文档顺序”取决于实现。）filter必须是一个jsonb数组，其中包含0个或多个关键字：\"string\"（包括所有字符串值），\"numeric\"（包括所有数值），\"boolean\"（包括所有布尔值），\"key\"（包括所有键），或 \"all\"（包括以上所有内容）。作为一种特殊情况，该filter也可以是这些关键字之一的简单JSON值。","description_zh_html":"选择\u003cem class=\"parameter\"\u003e\u003ccode\u003efilter\u003c/code\u003e\u003c/em\u003e请求的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取决于实现。）\u003cem class=\"parameter\"\u003e\u003ccode\u003efilter\u003c/code\u003e\u003c/em\u003e必须是一个\u003ccode class=\"type\"\u003ejsonb\u003c/code\u003e数组，其中包含0个或多个关键字：\u003ccode class=\"literal\"\u003e\"string\"\u003c/code\u003e（包括所有字符串值），\u003ccode class=\"literal\"\u003e\"numeric\"\u003c/code\u003e（包括所有数值），\u003ccode class=\"literal\"\u003e\"boolean\"\u003c/code\u003e（包括所有布尔值），\u003ccode class=\"literal\"\u003e\"key\"\u003c/code\u003e（包括所有键），或 \u003ccode class=\"literal\"\u003e\"all\"\u003c/code\u003e（包括以上所有内容）。作为一种特殊情况，该\u003cem class=\"parameter\"\u003e\u003ccode\u003efilter\u003c/code\u003e\u003c/em\u003e也可以是这些关键字之一的简单JSON值。","signatures":[{"description_zh":"选择filter请求的JSON文档中的每个项，并将每个项转换为tsvector，根据指定的或默认配置对单词进行正规化。然后将结果按文档顺序连接起来以产生输出。位置信息就像在每对选定的项目之间存在一个停用词一样生成。（注意，当输入为jsonb时，JSON对象字段的“文档顺序”取决于实现。）filter必须是一个jsonb数组，其中包含0个或多个关键字：\"string\"（包括所有字符串值），\"numeric\"（包括所有数值），\"boolean\"（包括所有布尔值），\"key\"（包括所有键），或 \"all\"（包括以上所有内容）。作为一种特殊情况，该filter也可以是这些关键字之一的简单JSON值。","description_zh_html":"选择\u003cem class=\"parameter\"\u003e\u003ccode\u003efilter\u003c/code\u003e\u003c/em\u003e请求的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取决于实现。）\u003cem class=\"parameter\"\u003e\u003ccode\u003efilter\u003c/code\u003e\u003c/em\u003e必须是一个\u003ccode class=\"type\"\u003ejsonb\u003c/code\u003e数组，其中包含0个或多个关键字：\u003ccode class=\"literal\"\u003e\"string\"\u003c/code\u003e（包括所有字符串值），\u003ccode class=\"literal\"\u003e\"numeric\"\u003c/code\u003e（包括所有数值），\u003ccode class=\"literal\"\u003e\"boolean\"\u003c/code\u003e（包括所有布尔值），\u003ccode class=\"literal\"\u003e\"key\"\u003c/code\u003e（包括所有键），或 \u003ccode class=\"literal\"\u003e\"all\"\u003c/code\u003e（包括以上所有内容）。作为一种特殊情况，该\u003cem class=\"parameter\"\u003e\u003ccode\u003efilter\u003c/code\u003e\u003c/em\u003e也可以是这些关键字之一的简单JSON值。","returns":"tsvector","text":"json_to_tsvector ( [ config regconfig, ] document json, filter jsonb ) → tsvector","zh_from":"doc"}],"zh_from":"doc"}},"RequestedLocale":"zh-Hans","Fallback":false,"Versions":["13","14","15","16","17","18","19","20"],"Locales":["en","zh-Hans"],"Signatures":[{"Version":"18","Ordinal":0,"Hash":"f6a7d5026e0ba25dad5632777468c710dcf111aec9d3ce5f6d44146b19ab6848","Text":"json_to_tsvector ( [ config regconfig, ] document json, filter jsonb ) → tsvector","Returns":"tsvector","Payload":{"description":"Selects each item in the JSON document that is requested by the filter and converts each one 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 selected items. (Beware that “document order” of the fields of a JSON object is implementation-dependent when the input is jsonb.) The filter must be a jsonb array containing zero or more of these keywords: \"string\" (to include all string values), \"numeric\" (to include all numeric values), \"boolean\" (to include all boolean values), \"key\" (to include all keys), or \"all\" (to include all the above). As a special case, the filter can also be a simple JSON value that is one of these keywords.","description_html":"Selects each item in the JSON document that is requested by the \u003cem class=\"parameter\"\u003e\u003ccode\u003efilter\u003c/code\u003e\u003c/em\u003e and converts each one 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 selected items. (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.) The \u003cem class=\"parameter\"\u003e\u003ccode\u003efilter\u003c/code\u003e\u003c/em\u003e must be a \u003ccode class=\"type\"\u003ejsonb\u003c/code\u003e array containing zero or more of these keywords: \u003ccode class=\"literal\"\u003e\"string\"\u003c/code\u003e (to include all string values), \u003ccode class=\"literal\"\u003e\"numeric\"\u003c/code\u003e (to include all numeric values), \u003ccode class=\"literal\"\u003e\"boolean\"\u003c/code\u003e (to include all boolean values), \u003ccode class=\"literal\"\u003e\"key\"\u003c/code\u003e (to include all keys), or \u003ccode class=\"literal\"\u003e\"all\"\u003c/code\u003e (to include all the above). As a special case, the \u003cem class=\"parameter\"\u003e\u003ccode\u003efilter\u003c/code\u003e\u003c/em\u003e can also be a simple JSON value that is one of these keywords.","description_zh":"","description_zh_html":"","examples":[{"expr":"json_to_tsvector('english', '{\"a\": \"The Fat Rats\", \"b\": 123}'::json, '[\"string\", \"numeric\"]')","result":"'123':5 'fat':2 'rat':3"},{"expr":"json_to_tsvector('english', '{\"cat\": \"The Fat Rats\", \"dog\": 123}'::json, '\"all\"')","result":"'123':9 'cat':1 'dog':7 'fat':4 'rat':5"}],"html":"\u003ccode class=\"function\"\u003ejson_to_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, \u003cem class=\"parameter\"\u003e\u003ccode\u003efilter\u003c/code\u003e\u003c/em\u003e \u003ccode class=\"type\"\u003ejsonb\u003c/code\u003e ) → \u003ccode class=\"returnvalue\"\u003etsvector\u003c/code\u003e","returns":"tsvector","text":"json_to_tsvector ( [ config regconfig, ] document json, filter jsonb ) → tsvector","zh_from":""}}],"Spellings":null,"SQLState":null,"Evidence":null}
