{"Entry":{"collection":"func","key":"setweight","name":"setweight","aliases":[],"metadata":{"changed_in":["9.6"],"changes":[{"descriptions_changed":false,"doc_overhaul":false,"from":"8.2","group_changed":null,"signatures":{"added":[],"removed":[]},"status":"added","to":"8.3"},{"descriptions_changed":true,"doc_overhaul":false,"from":"9.5","group_changed":null,"signatures":{"added":["setweight ( vector tsvector, weight \"char\" ) → tsvector","setweight ( vector tsvector, weight \"char\", lexemes text[] ) → tsvector"],"removed":["setweight ( tsvector, \"char\" ) → tsvector"]},"status":"changed","to":"9.6"},{"descriptions_changed":false,"doc_overhaul":true,"from":"12","group_changed":null,"signatures":{"added":[],"removed":[]},"status":"changed","to":"13"}],"content_hash":"951fd8ed4e5c587a0a0a780b0c7962fcafd35568ae1a61e65aadfd3f11588f4a","derived_content_hash":"302290ed070bfd8ebd0ae1343be85c1bc0bef443000ed30fe695240cf1098341","documentation_refresh":{"batch":"20261113","original_source_rev":"wiki-repair-20261023:1e8d6766f468771ace7c564aec7ab824de50c0293da06ed0a16eef1833d32eb1","versions":{"14":"14.25","15":"15.20","16":"16.16","17":"17.12","18":"18.7","19":"19rc2"}},"first_version":"8.3","group":"textsearch","group_label":"Text Search Functions And Operators","groups":["textsearch"],"imported_at":"2026-09-27T17:57:28.704269+08:00","last_version":"20","name":"setweight","name_key":"setweight","position":12008,"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"],"repair_provenance":{"original_source_revision":"wiki-repair-20261023:26c3ba1ba0f41b67fc59fbeab4f9bad9b66d495881530b65b727ca691303f99a","receipt_sha256":"1dd01cf3ab7594ac19e71093125dfc4d1a602d3eacbb855c35312cf67f63d28a","repair":"wiki-repair-20261023"},"signature":"setweight ( vector tsvector, weight \"char\" ) → tsvector","signature_count":2,"slug":"setweight","source_rev":"wiki-repair-20261023:1e8d6766f468771ace7c564aec7ab824de50c0293da06ed0a16eef1833d32eb1","summary":"Assigns the specified weight to each element of the vector.","summary_zh":""}},"Definition":{"Collection":"func","Key":"setweight","SourceDatabase":"center","Version":"18","SourceTable":"func","SourceKey":"setweight","SourceRevision":"wiki-repair-20261023:1e8d6766f468771ace7c564aec7ab824de50c0293da06ed0a16eef1833d32eb1","Facts":{"description":"Assigns the specified weight to each element of the vector.","description_html":"Assigns the specified \u003cem class=\"parameter\"\u003e\u003ccode\u003eweight\u003c/code\u003e\u003c/em\u003e to each element of the \u003cem class=\"parameter\"\u003e\u003ccode\u003evector\u003c/code\u003e\u003c/em\u003e.","description_zh":"将指定的 weight 赋给 vector 的每个元素。","description_zh_html":"将指定的 \u003cem class=\"parameter\"\u003e\u003ccode\u003eweight\u003c/code\u003e\u003c/em\u003e 赋给 \u003cem class=\"parameter\"\u003e\u003ccode\u003evector\u003c/code\u003e\u003c/em\u003e 的每个元素。","doc":{"anchor":"TEXTSEARCH-FUNCTIONS-TABLE","file":"functions-textsearch.html","sha256":"2383d74fd6eee4b71e1b97dec9754623081103120b67a9793f8deac5fff77727","slug":"18"},"documentation_revision":{"inputs":[{"file":"functions-textsearch.html","kind":"same-version-reviewed-manual","locale":"en","sha256":"2383d74fd6eee4b71e1b97dec9754623081103120b67a9793f8deac5fff77727","version":"18.7"},{"file":"functions-textsearch.html","kind":"same-version-reviewed-manual","locale":"zh-Hans","sha256":"d8d1661c6d67bb109c5266be16236950471c11d91181aafa96e9055792c4fa78","version":"18.7"}],"release":"18.7","runtime_remeasured":false,"source_revision":"pgdoc:b9f0e7232f60f380d642ac9b99226606c254b552"},"group":"textsearch","group_label":"文本搜索函数和操作符","lang":"en","layout":"table-new","pages":["functions-textsearch.html"],"prose_only":false,"signatures":[{"description":"Assigns the specified weight to each element of the vector.","description_html":"Assigns the specified \u003cem class=\"parameter\"\u003e\u003ccode\u003eweight\u003c/code\u003e\u003c/em\u003e to each element of the \u003cem class=\"parameter\"\u003e\u003ccode\u003evector\u003c/code\u003e\u003c/em\u003e.","description_zh":"将指定的 weight 赋给 vector 的每个元素。","description_zh_html":"将指定的 \u003cem class=\"parameter\"\u003e\u003ccode\u003eweight\u003c/code\u003e\u003c/em\u003e 赋给 \u003cem class=\"parameter\"\u003e\u003ccode\u003evector\u003c/code\u003e\u003c/em\u003e 的每个元素。","examples":[{"expr":"setweight('fat:2,4 cat:3 rat:5B'::tsvector, 'A')","result":"'cat':3A 'fat':2A,4A 'rat':5A"}],"html":"\u003ccode class=\"function\"\u003esetweight\u003c/code\u003e ( \u003cem class=\"parameter\"\u003e\u003ccode\u003evector\u003c/code\u003e\u003c/em\u003e \u003ccode class=\"type\"\u003etsvector\u003c/code\u003e, \u003cem class=\"parameter\"\u003e\u003ccode\u003eweight\u003c/code\u003e\u003c/em\u003e \u003ccode class=\"type\"\u003e\"char\"\u003c/code\u003e ) → \u003ccode class=\"returnvalue\"\u003etsvector\u003c/code\u003e","returns":"tsvector","text":"setweight ( vector tsvector, weight \"char\" ) → tsvector","zh_from":"same-version-manual"},{"description":"Assigns the specified weight to elements of the vector that are listed in lexemes. The strings in lexemes are taken as lexemes as-is, without further processing. Strings that do not match any lexeme in vector are ignored.","description_html":"Assigns the specified \u003cem class=\"parameter\"\u003e\u003ccode\u003eweight\u003c/code\u003e\u003c/em\u003e to elements of the \u003cem class=\"parameter\"\u003e\u003ccode\u003evector\u003c/code\u003e\u003c/em\u003e that are listed in \u003cem class=\"parameter\"\u003e\u003ccode\u003elexemes\u003c/code\u003e\u003c/em\u003e. The strings in \u003cem class=\"parameter\"\u003e\u003ccode\u003elexemes\u003c/code\u003e\u003c/em\u003e are taken as lexemes as-is, without further processing. Strings that do not match any lexeme in \u003cem class=\"parameter\"\u003e\u003ccode\u003evector\u003c/code\u003e\u003c/em\u003e are ignored.","description_zh":"为 vector 中列在 lexemes 内的元素赋予指定的 weight。lexemes 中的字符串按原样用作词位，不经过进一步处理。不匹配 vector 中任何词位的字符串将被忽略。","description_zh_html":"为 \u003cem class=\"parameter\"\u003e\u003ccode\u003evector\u003c/code\u003e\u003c/em\u003e 中列在 \u003cem class=\"parameter\"\u003e\u003ccode\u003elexemes\u003c/code\u003e\u003c/em\u003e 内的元素赋予指定的 \u003cem class=\"parameter\"\u003e\u003ccode\u003eweight\u003c/code\u003e\u003c/em\u003e。\u003cem class=\"parameter\"\u003e\u003ccode\u003elexemes\u003c/code\u003e\u003c/em\u003e 中的字符串按原样用作词位，不经过进一步处理。不匹配 \u003cem class=\"parameter\"\u003e\u003ccode\u003evector\u003c/code\u003e\u003c/em\u003e 中任何词位的字符串将被忽略。","examples":[{"expr":"setweight('fat:2,4 cat:3 rat:5,6B'::tsvector, 'A', '{cat,rat}')","result":"'cat':3A 'fat':2,4 'rat':5A,6A"}],"html":"\u003ccode class=\"function\"\u003esetweight\u003c/code\u003e ( \u003cem class=\"parameter\"\u003e\u003ccode\u003evector\u003c/code\u003e\u003c/em\u003e \u003ccode class=\"type\"\u003etsvector\u003c/code\u003e, \u003cem class=\"parameter\"\u003e\u003ccode\u003eweight\u003c/code\u003e\u003c/em\u003e \u003ccode class=\"type\"\u003e\"char\"\u003c/code\u003e, \u003cem class=\"parameter\"\u003e\u003ccode\u003elexemes\u003c/code\u003e\u003c/em\u003e \u003ccode class=\"type\"\u003etext[]\u003c/code\u003e ) → \u003ccode class=\"returnvalue\"\u003etsvector\u003c/code\u003e","returns":"tsvector","text":"setweight ( vector tsvector, weight \"char\", lexemes text[] ) → tsvector","zh_from":"same-version-manual"}],"translation_provenance":{"inputs":[{"kind":"current-pgdoc-translation","path":"/Users/vonng/pgsty/pgdoc/zh/18/html/functions-textsearch.html","sha256":"8401bb0d06633da86885cceee001a41a7bc026a1e7cb38731a171ec09f7e10a4"}],"kind":"same-version-pgdoc","locale":"zh-Hans","source_revision":"b1b500221dbe5437cfca004d6b04d3f6e422765d","version":"18"},"zh_from":"same-version-manual"},"ManualEvidence":{"doc":{"anchor":"TEXTSEARCH-FUNCTIONS-TABLE","file":"functions-textsearch.html","sha256":"2383d74fd6eee4b71e1b97dec9754623081103120b67a9793f8deac5fff77727","slug":"18"}},"MeasuredEvidence":{}},"Text":{"Collection":"func","Key":"setweight","SourceDatabase":"center","Version":"18","Locale":"en","Title":"setweight","Summary":"Assigns the specified weight to each element of the vector.","BodyHTML":"Assigns the specified \u003cem\u003e\u003ccode\u003eweight\u003c/code\u003e\u003c/em\u003e to each element of the \u003cem\u003e\u003ccode\u003evector\u003c/code\u003e\u003c/em\u003e.","SourceRevision":"wiki-repair-20261023:1e8d6766f468771ace7c564aec7ab824de50c0293da06ed0a16eef1833d32eb1","ContentHash":"c3d3f38c9eca7aef7decd822faf95a89d2a4bf8ebbd977bafa1d25e8baf40c16","Payload":{"description":"Assigns the specified weight to each element of the vector.","description_html":"Assigns the specified \u003cem class=\"parameter\"\u003e\u003ccode\u003eweight\u003c/code\u003e\u003c/em\u003e to each element of the \u003cem class=\"parameter\"\u003e\u003ccode\u003evector\u003c/code\u003e\u003c/em\u003e.","signatures":[{"description":"Assigns the specified weight to each element of the vector.","description_html":"Assigns the specified \u003cem class=\"parameter\"\u003e\u003ccode\u003eweight\u003c/code\u003e\u003c/em\u003e to each element of the \u003cem class=\"parameter\"\u003e\u003ccode\u003evector\u003c/code\u003e\u003c/em\u003e.","description_zh":"将指定的 weight 赋给 vector 的每个元素。","description_zh_html":"将指定的 \u003cem class=\"parameter\"\u003e\u003ccode\u003eweight\u003c/code\u003e\u003c/em\u003e 赋给 \u003cem class=\"parameter\"\u003e\u003ccode\u003evector\u003c/code\u003e\u003c/em\u003e 的每个元素。","examples":[{"expr":"setweight('fat:2,4 cat:3 rat:5B'::tsvector, 'A')","result":"'cat':3A 'fat':2A,4A 'rat':5A"}],"html":"\u003ccode class=\"function\"\u003esetweight\u003c/code\u003e ( \u003cem class=\"parameter\"\u003e\u003ccode\u003evector\u003c/code\u003e\u003c/em\u003e \u003ccode class=\"type\"\u003etsvector\u003c/code\u003e, \u003cem class=\"parameter\"\u003e\u003ccode\u003eweight\u003c/code\u003e\u003c/em\u003e \u003ccode class=\"type\"\u003e\"char\"\u003c/code\u003e ) → \u003ccode class=\"returnvalue\"\u003etsvector\u003c/code\u003e","returns":"tsvector","text":"setweight ( vector tsvector, weight \"char\" ) → tsvector","zh_from":"same-version-manual"},{"description":"Assigns the specified weight to elements of the vector that are listed in lexemes. The strings in lexemes are taken as lexemes as-is, without further processing. Strings that do not match any lexeme in vector are ignored.","description_html":"Assigns the specified \u003cem class=\"parameter\"\u003e\u003ccode\u003eweight\u003c/code\u003e\u003c/em\u003e to elements of the \u003cem class=\"parameter\"\u003e\u003ccode\u003evector\u003c/code\u003e\u003c/em\u003e that are listed in \u003cem class=\"parameter\"\u003e\u003ccode\u003elexemes\u003c/code\u003e\u003c/em\u003e. The strings in \u003cem class=\"parameter\"\u003e\u003ccode\u003elexemes\u003c/code\u003e\u003c/em\u003e are taken as lexemes as-is, without further processing. Strings that do not match any lexeme in \u003cem class=\"parameter\"\u003e\u003ccode\u003evector\u003c/code\u003e\u003c/em\u003e are ignored.","description_zh":"为 vector 中列在 lexemes 内的元素赋予指定的 weight。lexemes 中的字符串按原样用作词位，不经过进一步处理。不匹配 vector 中任何词位的字符串将被忽略。","description_zh_html":"为 \u003cem class=\"parameter\"\u003e\u003ccode\u003evector\u003c/code\u003e\u003c/em\u003e 中列在 \u003cem class=\"parameter\"\u003e\u003ccode\u003elexemes\u003c/code\u003e\u003c/em\u003e 内的元素赋予指定的 \u003cem class=\"parameter\"\u003e\u003ccode\u003eweight\u003c/code\u003e\u003c/em\u003e。\u003cem class=\"parameter\"\u003e\u003ccode\u003elexemes\u003c/code\u003e\u003c/em\u003e 中的字符串按原样用作词位，不经过进一步处理。不匹配 \u003cem class=\"parameter\"\u003e\u003ccode\u003evector\u003c/code\u003e\u003c/em\u003e 中任何词位的字符串将被忽略。","examples":[{"expr":"setweight('fat:2,4 cat:3 rat:5,6B'::tsvector, 'A', '{cat,rat}')","result":"'cat':3A 'fat':2,4 'rat':5A,6A"}],"html":"\u003ccode class=\"function\"\u003esetweight\u003c/code\u003e ( \u003cem class=\"parameter\"\u003e\u003ccode\u003evector\u003c/code\u003e\u003c/em\u003e \u003ccode class=\"type\"\u003etsvector\u003c/code\u003e, \u003cem class=\"parameter\"\u003e\u003ccode\u003eweight\u003c/code\u003e\u003c/em\u003e \u003ccode class=\"type\"\u003e\"char\"\u003c/code\u003e, \u003cem class=\"parameter\"\u003e\u003ccode\u003elexemes\u003c/code\u003e\u003c/em\u003e \u003ccode class=\"type\"\u003etext[]\u003c/code\u003e ) → \u003ccode class=\"returnvalue\"\u003etsvector\u003c/code\u003e","returns":"tsvector","text":"setweight ( vector tsvector, weight \"char\", lexemes text[] ) → tsvector","zh_from":"same-version-manual"}]}},"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":[{"Version":"18","Ordinal":0,"Hash":"68a976c8107492d7fa2052e63853ffb5eb5be61b1ccee90d1f53468626596f22","Text":"setweight ( vector tsvector, weight \"char\" ) → tsvector","Returns":"tsvector","Payload":{"description":"Assigns the specified weight to each element of the vector.","description_html":"Assigns the specified \u003cem class=\"parameter\"\u003e\u003ccode\u003eweight\u003c/code\u003e\u003c/em\u003e to each element of the \u003cem class=\"parameter\"\u003e\u003ccode\u003evector\u003c/code\u003e\u003c/em\u003e.","description_zh":"将指定的 weight 赋给 vector 的每个元素。","description_zh_html":"将指定的 \u003cem class=\"parameter\"\u003e\u003ccode\u003eweight\u003c/code\u003e\u003c/em\u003e 赋给 \u003cem class=\"parameter\"\u003e\u003ccode\u003evector\u003c/code\u003e\u003c/em\u003e 的每个元素。","examples":[{"expr":"setweight('fat:2,4 cat:3 rat:5B'::tsvector, 'A')","result":"'cat':3A 'fat':2A,4A 'rat':5A"}],"html":"\u003ccode class=\"function\"\u003esetweight\u003c/code\u003e ( \u003cem class=\"parameter\"\u003e\u003ccode\u003evector\u003c/code\u003e\u003c/em\u003e \u003ccode class=\"type\"\u003etsvector\u003c/code\u003e, \u003cem class=\"parameter\"\u003e\u003ccode\u003eweight\u003c/code\u003e\u003c/em\u003e \u003ccode class=\"type\"\u003e\"char\"\u003c/code\u003e ) → \u003ccode class=\"returnvalue\"\u003etsvector\u003c/code\u003e","returns":"tsvector","text":"setweight ( vector tsvector, weight \"char\" ) → tsvector","zh_from":"same-version-manual"}},{"Version":"18","Ordinal":1,"Hash":"56679dd2a48c1b35dce6531b1728ed3fa15f816d7d4829a6ce565d94daac861d","Text":"setweight ( vector tsvector, weight \"char\", lexemes text[] ) → tsvector","Returns":"tsvector","Payload":{"description":"Assigns the specified weight to elements of the vector that are listed in lexemes. The strings in lexemes are taken as lexemes as-is, without further processing. Strings that do not match any lexeme in vector are ignored.","description_html":"Assigns the specified \u003cem class=\"parameter\"\u003e\u003ccode\u003eweight\u003c/code\u003e\u003c/em\u003e to elements of the \u003cem class=\"parameter\"\u003e\u003ccode\u003evector\u003c/code\u003e\u003c/em\u003e that are listed in \u003cem class=\"parameter\"\u003e\u003ccode\u003elexemes\u003c/code\u003e\u003c/em\u003e. The strings in \u003cem class=\"parameter\"\u003e\u003ccode\u003elexemes\u003c/code\u003e\u003c/em\u003e are taken as lexemes as-is, without further processing. Strings that do not match any lexeme in \u003cem class=\"parameter\"\u003e\u003ccode\u003evector\u003c/code\u003e\u003c/em\u003e are ignored.","description_zh":"为 vector 中列在 lexemes 内的元素赋予指定的 weight。lexemes 中的字符串按原样用作词位，不经过进一步处理。不匹配 vector 中任何词位的字符串将被忽略。","description_zh_html":"为 \u003cem class=\"parameter\"\u003e\u003ccode\u003evector\u003c/code\u003e\u003c/em\u003e 中列在 \u003cem class=\"parameter\"\u003e\u003ccode\u003elexemes\u003c/code\u003e\u003c/em\u003e 内的元素赋予指定的 \u003cem class=\"parameter\"\u003e\u003ccode\u003eweight\u003c/code\u003e\u003c/em\u003e。\u003cem class=\"parameter\"\u003e\u003ccode\u003elexemes\u003c/code\u003e\u003c/em\u003e 中的字符串按原样用作词位，不经过进一步处理。不匹配 \u003cem class=\"parameter\"\u003e\u003ccode\u003evector\u003c/code\u003e\u003c/em\u003e 中任何词位的字符串将被忽略。","examples":[{"expr":"setweight('fat:2,4 cat:3 rat:5,6B'::tsvector, 'A', '{cat,rat}')","result":"'cat':3A 'fat':2,4 'rat':5A,6A"}],"html":"\u003ccode class=\"function\"\u003esetweight\u003c/code\u003e ( \u003cem class=\"parameter\"\u003e\u003ccode\u003evector\u003c/code\u003e\u003c/em\u003e \u003ccode class=\"type\"\u003etsvector\u003c/code\u003e, \u003cem class=\"parameter\"\u003e\u003ccode\u003eweight\u003c/code\u003e\u003c/em\u003e \u003ccode class=\"type\"\u003e\"char\"\u003c/code\u003e, \u003cem class=\"parameter\"\u003e\u003ccode\u003elexemes\u003c/code\u003e\u003c/em\u003e \u003ccode class=\"type\"\u003etext[]\u003c/code\u003e ) → \u003ccode class=\"returnvalue\"\u003etsvector\u003c/code\u003e","returns":"tsvector","text":"setweight ( vector tsvector, weight \"char\", lexemes text[] ) → tsvector","zh_from":"same-version-manual"}}],"Spellings":null,"SQLState":null,"Evidence":null}
