Re: Synonyms in doc search

From: Oleg Bartunov <obartunov(at)postgrespro(dot)ru>
To: Daniel Gustafsson <daniel(at)yesql(dot)se>
Cc: Magnus Hagander <magnus(at)hagander(dot)net>, PostgreSQL WWW <pgsql-www(at)postgresql(dot)org>
Subject: Re: Synonyms in doc search
Date: 2018-10-17 19:38:44
Message-ID: CAF4Au4xzPUcdN7zDpn5S+WHqTVe+uBsRXyFvE-LhBEy=fJ=Bwg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-www

On Mon, Oct 15, 2018 at 2:41 PM Daniel Gustafsson <daniel(at)yesql(dot)se> wrote:
>
> > On 14 Oct 2018, at 18:47, Magnus Hagander <magnus(at)hagander(dot)net> wrote:
> >
> > On Sat, Oct 13, 2018 at 1:15 AM Daniel Gustafsson <daniel(at)yesql(dot)se <mailto:daniel(at)yesql(dot)se>> wrote:
> > Is is possible to add synonyms (in some way, or similar functionality) to the
> > docs search in order to promote content? I just searched for TLS in the v10
> > docs and the number one hit, out of meagre 7 in total, is the 9.1.17 release
> > notes. If I instead search for SSL there are 130 hits with the first one being
> > the relevant page. Personally I know the reason for this, but a newcomer is
> > unlikely to.
> >
> > We don't have the ability to do this specifically for the docs search, but we could do it globally across either all the website search or even all the website + all the archives. A bit of a pain to reindex the archives (especially since I just did it a couple of days ago, see note on -www about downtime), but the website part should be quick. It's just a tsearch synonym dictionary...
> >
> > If we do want to do that, we may want to give some thought to if we should add any more synonoyms at the same time?
>
> I see, I was hoping it would be a simpler fix. I still think TLS should be
> added as a synonym, but there is no rush of course. Whenever indexing happens
> next would be good.

It's possible to do without reindexing, just try ts_rewrite

create table aliases( t tsquery primary key, s tsquery);
insert into aliases values(to_tsquery('supernovae'),
to_tsquery('supernovae|sn'));
select ts_rewrite(to_tsquery('supernovae'),
'select * from aliases');
ts_rewrite
--------------------
'supernova' | 'sn'
(1 row)

>
> cheers ./daniel

--
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company

In response to

Browse pgsql-www by date

  From Date Subject
Next Message Jonathan S. Katz 2018-10-17 20:20:15 Re: Missing space between mailing lists links
Previous Message Stefan Kaltenbrunner 2018-10-17 16:29:04 Re: upcoming postgresql.org infrastructure migration