Re: tsearch2: plainto_tsquery() with OR?

From: Ron Mayer <rm_pg(at)cheapcomplexdevices(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, oleg(at)sai(dot)msu(dot)su
Subject: Re: tsearch2: plainto_tsquery() with OR?
Date: 2007-08-13 14:44:24
Message-ID: 46C06E48.6090904@cheapcomplexdevices.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Tom Lane 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.

For what it's worth, Google states [1]

Automatic "and" queries

By default, Google only returns pages that include
all of your search terms. There is no need to
include "and" between terms. Keep in mind that
the order in which the terms are typed will affect
the search results. To restrict a search further,
just include more terms. For example, to plan a
vacation to Hawaii, simply type vacation hawaii.

and also describes "OPERATOR EXAMPLE...vacation hawaii"
as "FINDS PAGES CONTAINING...the words vacation and Hawaii".

If I'm not mistaken, it sounds the same as what tsearch describes.

[1] http://www.google.com/intl/en/help/basics.html#and
[2] http://www.google.com/intl/en/help/cheatsheet.html

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Erik Jones 2007-08-13 14:44:26 Re: Persistent connections in PHP
Previous Message Jeff Lanzarotta 2007-08-13 14:43:08 Re: Selecting rows where timestamp between two timestamps