试图弄清楚为什么下面的查询没有返回任何结果:
select id from story where tsv_story_text @@ to_tsquery('CumEx-Files<->2.0');
该术语存在于数据库(PostgreSQL 11.12)中一个故事的标题中,例如:
CumEx-Files 2.0 investigation reveals €150bn tax fraud
我可以让查询工作的唯一方法是在向量和有效的查询中用破折号替换连字符,所以我尝试调试这个短语,但似乎连字符只是一个空格符号 - 我认为它必须对短语中的数字做些什么,或者是吗?
SELECT * FROM ts_debug('english', 'CumEx-Files<->2.0');
alias | description | token | dictionaries | dictionary | lexemes
-----------------+---------------------------------+-------------+----------------+--------------+-------------
asciihword | Hyphenated word, all ASCII | CumEx-Files | {english_stem} | english_stem | {cumex-fil}
hword_asciipart | Hyphenated word part, all ASCII | CumEx | {english_stem} | english_stem | {cumex}
blank | Space symbols | - | {} | |
hword_asciipart | Hyphenated word part, all ASCII | Files | {english_stem} | english_stem | {file}
blank | Space symbols | < | {} | |
blank | Space symbols | -> | {} | |
float | Decimal notation | 2.0 | {simple} | simple | {2.0}