I have a noticed a likely bug when using ts_headline with the <-> operator
Assuming the following query:
SELECT ts_headline('English','This Commercial Bank does not have any Equity in Europe but European Commercial Bank does', phraseto_tsquery('English','European Commercial Bank')::tsquery);
The returned result is: This <b>Commercial</b> <b>Bank</b> does not have any Equity in Europe but <b>European</b> <b>Commercial</b> <b>Bank</b> does
This highlights the words Commercial & Bank separately in addition to European Commercial Bank.
However, the correct output expected should be: This Commercial Bank does not have any Equity in Europe but <b>European</b> <b>Commercial</b> <b>Bank</b> does
Which only highlights *European Commercial Bank* due to the <-> operator in phraseto_tsquery.
SELECT phraseto_tsquery('English','European Commercial Bank'); returns 'european' <-> 'commerci' <-> 'bank' as expected indicating the problem is with ts_headline function.