Re: tsearch2: plainto_tsquery() with OR?

From: "Trevor Talbot" <quension(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: tsearch2: plainto_tsquery() with OR?
Date: 2007-08-09 06:47:03
Message-ID: 90bce5730708082347q916483aldd866a2696490b1a@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 8/8/07, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Oleg Bartunov <oleg(at)sai(dot)msu(dot)su> writes:
> > On Wed, 8 Aug 2007, cluster wrote:
> >> Does anyone know where I can request an OR-version of plainto_tsquery()?
>
> > plainto_tsquery expects plain text, use to_tsquery for boolean operators.
>
> Are either of these definitions really right? If I type "foo bar baz"
> into Google, for instance, it seems to produce some sort of weighted
> result, neither a strict AND nor a strict OR. Google didn't get where
> they are by misjudging what the simplest search behavior should be like.

As far as I'm aware Google is normally AND -- the catch is that it
doesn't always use keywords from the page itself. Sometimes it'll
look for search terms that appear in pages that link to the returned
one; the cached version will notify you of this in the header.
Ranking seems to make words weighted by order and proximity, but of
course Google's full ranking behavior is another matter...

http://www.google.com/intl/en/help/basics.html#and
http://www.google.com/help/cheatsheet.html

For me personally, I expect to need a search interface that accepts
"AND", "OR", and "NOT" as boolean op words, and possibly parenthetical
grouping (IOW, everything to_tsquery supports in plain english form),
with freeform words defaulting to AND. Is this the same thing most
people need? I doubt it.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Oleg Bartunov 2007-08-09 06:51:19 Re: tsearch2: plainto_tsquery() with OR?
Previous Message Tom Lane 2007-08-09 06:40:07 Re: tsearch2: plainto_tsquery() with OR?