public inbox for [email protected]
help / color / mirror / Atom feedFrom: Jake North <[email protected]>
To: [email protected]
Subject: [feature request] ts_headline should have an option to highlight only full matches of <-> expressions
Date: Sat, 8 Jan 2022 20:09:24 +0100 (CET)
Message-ID: <[email protected]> (raw)
Hi,
I am using Postgres' full text search since some time now and overall it's working really well for me. However one issue I have is that ts_headline highlights partial matches of FOLLOWED BY (<->) expressions, e.g.
SELECT ts_headline('some words and some more words', to_tsquery('some<->words'));
gives
<b>some</b> <b>words</b> and <b>some</b> more <b>words</b>
while I expect
<b>some words</b> and some more words
I think the highlights of partial matches is in most cases not useful and confusing to end users, they may think the search did not recognize they requested the words to be consecutive. Google also does not highlight partial matches it seems.
I suspect to implement this would require substantial changes to ts_headline since it seems to treat the lexemes independently, but it would be a big improvement and should be the default behaviour.
Best regards,
Jake N
view thread (2+ messages)
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: [email protected]
Cc: [email protected], [email protected]
Subject: Re: [feature request] ts_headline should have an option to highlight only full matches of <-> expressions
In-Reply-To: <[email protected]>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox