array_to_tsvector(text[]) | tsvector | 将词素数组转换为tsvector | array_to_tsvector('{fat,cat,rat}'::text[]) | 'cat' 'fat' 'rat' |
get_current_ts_config() | regconfig | 获取默认的文本搜索配置 | get_current_ts_config() | english |
length(tsvector) | integer | tsvector 中的词素数量 | length('fat:2,4 cat:3 rat:5A'::tsvector) | 3 |
numnode(tsquery) | integer | tsquery 中的词素加运算符的数量 | numnode('(fat & rat) | cat'::tsquery) | 5 |
plainto_tsquery([ config regconfig , ] query text) | tsquery | 产生tsquery 忽略标点符号 | plainto_tsquery('english', 'The Fat Rats') | 'fat' & 'rat' |
phraseto_tsquery([ config regconfig , ] query text) | tsquery | 产生tsquery 来搜寻词组,而忽略标点符号 | phraseto_tsquery('english', 'The Fat Rats') | 'fat' <-> 'rat' |
querytree(query tsquery) | text | 获取tsquery 的可索引部分 | querytree('foo & ! bar'::tsquery) | 'foo' |
setweight(vector tsvector, weight "char") | tsvector | 将* weight 分配给 vector *的每个元素 | setweight('fat:2,4 cat:3 rat:5B'::tsvector, 'A') | 'cat':3A 'fat':2A,4A 'rat':5A |
setweight(vector tsvector, weight "char", lexemes text[]) | tsvector | 将* weight 分配给 lexemes 中列出的 vector *元素 | setweight('fat:2,4 cat:3 rat:5B'::tsvector, 'A', '{cat,rat}') | 'cat':3A 'fat':2,4 'rat':5A |
strip(tsvector) | tsvector | 从tsvector 移除位置和权重 | strip('fat:2,4 cat:3 rat:5A'::tsvector) | 'cat' 'fat' 'rat' |
to_tsquery([ config regconfig , ] query text) | tsquery | 标准化单词并转换为tsquery | to_tsquery('english', 'The & Fat & Rats') | 'fat' & 'rat' |
to_tsvector([ config regconfig , ] document text) | tsvector | 将文档 Literals 减少到tsvector | to_tsvector('english', 'The Fat Rats') | 'fat':2 'rat':3 |
to_tsvector([ config regconfig , ] document json(b)) | tsvector | 将文档中的每个字符串值都减小为tsvector ,然后按文档 Sequences 将其串联以产生单个tsvector | to_tsvector('english', '{"a": "The Fat Rats"}'::json) | 'fat':2 'rat':3 |
ts_delete(vector tsvector, lexeme text) | tsvector | 从* vector 中删除给定的 lexeme * | ts_delete('fat:2,4 cat:3 rat:5A'::tsvector, 'fat') | 'cat':3 'rat':5A |
ts_delete(vector tsvector, lexemes text[]) | tsvector | 从* vector 中删除 lexemes *中出现的所有词素 | ts_delete('fat:2,4 cat:3 rat:5A'::tsvector, ARRAY['fat','rat']) | 'cat':3 |
ts_filter(vector tsvector, weights "char"[]) | tsvector | 从* vector 中仅选择具有给定 weights *的元素 | ts_filter('fat:2,4 cat:3b rat:5A'::tsvector, '{a,b}') | 'cat':3B 'rat':5A |
ts_headline([ config regconfig, ] document text, query tsquery [, options text ]) | text | 显示查询匹配 | ts_headline('x y z', 'z'::tsquery) | x y <b>z</b> |
ts_headline([ config regconfig, ] document json(b), query tsquery [, options text ]) | text | 显示查询匹配 | ts_headline('{"a":"x y z"}'::json, 'z'::tsquery) | {"a":"x y <b>z</b>"} |
ts_rank([ weights float4[], ] vector tsvector, query tsquery [, normalization integer ]) | float4 | 排序查询文件 | ts_rank(textsearch, query) | 0.818 |
ts_rank_cd([ weights float4[], ] vector tsvector, query tsquery [, normalization integer ]) | float4 | 使用覆盖密度对文档进行排名以进行查询 | ts_rank_cd('{0.1, 0.2, 0.4, 1.0}', textsearch, query) | 2.01317 |
ts_rewrite(query tsquery, target tsquery, substitute tsquery) | tsquery | 在查询中将* target 替换为 substitute * | ts_rewrite('a & b'::tsquery, 'a'::tsquery, 'foo|bar'::tsquery) | 'b' & ( 'foo' | 'bar' ) |
ts_rewrite(query tsquery, select text) | tsquery | 使用SELECT 命令替换目标和替代项 | SELECT ts_rewrite('a & b'::tsquery, 'SELECT t,s FROM aliases') | 'b' & ( 'foo' | 'bar' ) |
tsquery_phrase(query1 tsquery, query2 tsquery) | tsquery | 进行查询,搜索* query1 后跟 query2 *(与<-> 运算符相同) | tsquery_phrase(to_tsquery('fat'), to_tsquery('cat')) | 'fat' <-> 'cat' |
tsquery_phrase(query1 tsquery, query2 tsquery, distance integer) | tsquery | 进行查询,搜索* query1 ,后跟 query2 * * distance * | tsquery_phrase(to_tsquery('fat'), to_tsquery('cat'), 10) | 'fat' <10> 'cat' |
tsvector_to_array(tsvector) | text[] | 将tsvector 转换为词素数组 | tsvector_to_array('fat:2,4 cat:3 rat:5A'::tsvector) | {cat,fat,rat} |
tsvector_update_trigger() | trigger | 触发功能,可自动更新tsvector 列 | CREATE TRIGGER ... tsvector_update_trigger(tsvcol, 'pg_catalog.swedish', title, body) |
tsvector_update_trigger_column() | trigger | 触发功能,可自动更新tsvector 列 | CREATE TRIGGER ... tsvector_update_trigger_column(tsvcol, configcol, title, body) |
unnest(tsvector, OUT lexeme text, OUT positions smallint[], OUT weights text) | setof record | 将tsvector 扩展到一组行 | unnest('fat:2,4 cat:3 rat:5A'::tsvector) | (cat,{3},{D}) ... |