全文搜索中权重参数的限制是什么

What is the limit for weight parameters in Full Text Search

我可以添加 4 个权重,但在添加第五个权重时出现错误

update pois 
set tsearch = setweight(to_tsvector(name), 'A') ||
              setweight(to_tsvector(coalesce(state_name, '')), 'B') ||
              setweight(to_tsvector(coalesce(city_name)), 'C') ||
              setweight(to_tsvector(coalesce(address, '')), 'D') ||   -- 4 weight work ok
              setweight(to_tsvector(coalesce(sector_name, '')), 'E'); -- add this and got error

ERROR: unrecognized weight: 69
SQL state: XX000

documentation 说你只能有 4:

setweight returns 输入向量的副本,其中每个位置都标有给定权重,A、B、C 或 D。(D 是新向量的默认值,因此不显示在输出中。)这些标签在连接向量时保留,允许来自文档不同部分的单词通过排名函数进行不同加权。

请注意,权重标签适用于位置,而不适用于词位。如果输入向量的位置被去除,那么 setweight 什么都不做。