Adding an alternate syntax for Phrase Search

From: Josh berkus <josh(at)agliodbs(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Adding an alternate syntax for Phrase Search
Date: 2016-05-22 17:52:38
Message-ID: 5741F1E6.60403@agliodbs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Folks,

This came up at pgCon.

The 'word <-> word <-> word' syntax for phrase search is not
developer-friendly. While we need the <-> operator for SQL and for the
sophisticated cases, it would be really good to support an alternate
syntax for the simplest case of "words next to each other". My proposal
is enclosing the phrase in double-quotes, which would be intuitive to
users and familiar from search engines. Thus:

to_tsquery(' Berkus & "PostgreSQL Version 10.0" ')

... would be equivalent to:

to_tsquery(' Berkus & ( PostgreSQL <-> version <-> 10.0 )')

I realize we're already in beta, but pgCon was actually the first time I
saw the new syntax. I think if we don't do this now, we'll be doing it
for 10.0.

--
--
Josh Berkus
Red Hat OSAS
(any opinions are my own)

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Thom Brown 2016-05-22 19:00:52 Re: Adding an alternate syntax for Phrase Search
Previous Message Tatsuo Ishii 2016-05-22 16:36:44 Re: Parallel query