Re: tsearch2: plainto_tsquery() with OR? - Mailing list pgsql-general

From Tom Lane
Subject Re: tsearch2: plainto_tsquery() with OR?
Date
Msg-id 4422.1186640086@sss.pgh.pa.us
Whole thread Raw
In response to Re: tsearch2: plainto_tsquery() with OR?  (Oleg Bartunov <oleg@sai.msu.su>)
Responses Re: tsearch2: plainto_tsquery() with OR?  (Oleg Bartunov <oleg@sai.msu.su>)
List pgsql-general
Oleg Bartunov <oleg@sai.msu.su> writes:
> " neither a strict AND nor a strict OR" is not a good foundation for
> database text search API.

Maybe not, but the Google boys have sure done well without telling
anyone what their algorithms are.

My feeling is that if you use an API that involves explicit AND and OR
operators (to_tsquery does this if I'm not mistaken) then you should
get a result that matches those semantics exactly.  But the other
behavior that people want is "here's some words, get me a weighted
result", and if the weighting improves from time to time that's OK.
We need to provide that API too.

Whether plainto_tsquery() should be defined that way, I'm not sure.
Maybe there's enough historical behavior behind it that we should
stick with defining it as "strict AND of these words".  But if so,
I want another function that has a fuzzier weighted definition,
because I think that'll be what most applications actually want.

The OP was asking for a version that has a strict OR behavior.
I'm not sure if that's really interesting or not ...

            regards, tom lane

pgsql-general by date:

Previous
From: Oleg Bartunov
Date:
Subject: Re: tsearch2: plainto_tsquery() with OR?
Next
From: Oleg Bartunov
Date:
Subject: Re: tsearch2: plainto_tsquery() with OR?