Re: Simplifying Text Search - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Simplifying Text Search
Date
Msg-id 2345.1195139621@sss.pgh.pa.us
Whole thread Raw
In response to Re: Simplifying Text Search  (Peter Eisentraut <peter_e@gmx.net>)
List pgsql-hackers
Peter Eisentraut <peter_e@gmx.net> writes:
> Am Mittwoch, 14. November 2007 schrieb Trevor Talbot:
>> But that coversion itself is fundamentally flawed, is the problem.

> I know it's incorrect, but with a different parser and/or dictionary you could 
> make it work.

No, I don't think so.  Trevor's killer point is that the token
boundaries chosen by the parser --- no matter *what* they are ---
might not line up with the substrings needed by a given LIKE pattern.
There isn't any mechanism in tsearch that will find the stored word
"foobar" if the search is for "foo" & "bar"; nor vice versa.

It might be possible to use a pg_trgm index in this way, since
AFAICT from the documents pg_trgm just chops up the substrings
blindly rather than trying to have smarts about word boundaries.

(And on third thought, I suppose you could emulate pg_tgrm with
a suitable parser and a lobotomized dictionary ... but it would
be pretty wasteful to use the tsearch mechanisms for that.)
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: LDC - Load Distributed Checkpoints with PG8.3b2 on Solaris
Next
From: Alvaro Herrera
Date:
Subject: Re: LDC - Load Distributed Checkpoints with PG8.3b2 on Solaris