作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有一个使用短语搜索来匹配整个短语的查询。
SELECT ts_headline(
'simple',
'This is my test text. My test text has many words. Well, not THAT many words.',
phraseto_tsquery('simple', 'text has many words')
);
This is my test <b>text</b>. My test <b>text</b> <b>has</b> <b>many</b> <b>words</b>. Well, not THAT <b>many</b> <b>words</b>.
This is my test text. My test <b>text</b> <b>has</b> <b>many</b> <b>words</b>. Well, not THAT many words.
This is my test text. My test <b>text has many words</b>. Well, not THAT many words.
phraseto_tsquery('simple', 'text has many words')
to_tsquery('simple', 'text <-> has <-> many <-> words')
最佳答案
phraseto_tsquery('simple', 'text has many words')
生成正确的查询,但问题似乎出在 ts_headline
功能。好像是已经报告的BUG #155172 .
关于postgresql - 如何让 ts_headline 尊重phraseto_tsquery,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49495941/
我已经成功地将单个单词的数组连接到 to_tsquery 的字符串中,但是 postgres 9.6 中的 phraseto_tsquery 只允许一个关键字短语。有谁知道以这种方式查询 tsvect
我在 9.5 手册中找到了对 phraseto_tsquery 的引用 https://postgrespro.com/docs/postgrespro/9.5/textsearch-controls
我是一名优秀的程序员,十分优秀!