mirror of
https://github.com/discourse/discourse.git
synced 2025-02-10 21:34:50 +00:00
Previously to_tsquery would split terms and join with & In PG 14 terms are split and use <-> which means followed directly by. In PG 13: discourse_test=# SELECT to_tsquery('english', '''hello world'''); to_tsquery --------------------- 'hello' & 'world' (1 row) In PG 14: discourse_test=# SELECT to_tsquery('english', '''hello world'''); to_tsquery --------------------- 'hello' <-> 'world' (1 row) Change is very unobtrosive, we simply amend our to_tsquery to behave like it used to behave and make no use of the `<->` operator More detail at: https://akorotkov.github.io/blog/2021/05/22/pg-14-query-parsing/ Note that plainto_tsquery used elsewhere in Discourse keeps the exact same function. This also corrects a faulty test that was passing by a fluke on older version of PG