pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: christian@games.no
To: pgsql-bugs@lists.postgresql.org
Subject: Bug Report | Using ts_headline with the <-> operator
Date: Wed, 20 Jan 2021 12:37:46 -0000
Message-ID: <011a01d6ef29$0e8e1b20$2baa5160$@games.no> (raw)

PostgreSQL version: 10.15

Operating system:   Linux/Ubuntu

 

Bug when using ts_headline with the <-> operator

 

Assuming the following query:

SELECT ts_headline('simple','The Cyberpunk launch did not go as expected for
Cyberpunk Fans around the world', phraseto_tsquery('simple','Cyberpunk
Fans')::tsquery);

 

The returned result is:

The <b>Cyberpunk</b> launch did not go as expected for <b>Cyberpunk</b>
<b>Fans</b> around the world

 

This highlights the Cyberpunk alone in addition to Cyberpunk Fans.

 

However, the expected output would be:

The Cyberpunk launch did not go as expected for <b>Cyberpunk</b> <b>Fans</b>
around the world

 

Which only highlights *Cyberpunk Fans* due to the <-> operator in
phraseto_tsquery.

 

SELECT phraseto_tsquery('simple','Cyberpunk Fans');

The above returns 'cyberpunk<-> 'fans' as expected, so presumably this is an
issue with the ts_headline function.

 

I would be great to see this fixed/improved in the near future.

 

Christian

view thread (2+ messages)  latest in thread

Message-ID: <011a01d6ef29$0e8e1b20$2baa5160$@games.no>
Permalink:  ../011a01d6ef29$0e8e1b20$2baa5160$@games.no/
Also on:    postgresql.org/message-id/011a01d6ef29$0e8e1b20$2baa5160$@games.no

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: christian@games.no, pgsql-bugs@lists.postgresql.org
  Subject: Re: Bug Report | Using ts_headline with the <-> operator
  In-Reply-To: <011a01d6ef29$0e8e1b20$2baa5160$@games.no>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox