小编Tom*_*rek的帖子

从tsvector中检索词条出现的位置和数量

有没有办法获得有关句子中词汇位置和tsvector出现次数的信息?

像这样的东西

SELECT *
FROM get_position(to_tsvector('english', 'The Fat Rats'), to_tsquery('Rats'));
Run Code Online (Sandbox Code Playgroud)

将返回3

SELECT *
FROM get_occurrences(to_tsvector('english', 'The Fat Rats'), to_tsquery('Rats'));
Run Code Online (Sandbox Code Playgroud)

将返回1.

sql postgresql full-text-search tsvector

6
推荐指数
1
解决办法
641
查看次数

标签 统计

full-text-search ×1

postgresql ×1

sql ×1

tsvector ×1