Re: Simplifying Text Search

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: "Trevor Talbot" <quension(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Simplifying Text Search
Date: 2007-11-15 15:13:41
Message-ID: 2345.1195139621@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Peter Eisentraut <peter_e(at)gmx(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2007-11-15 15:24:39 Re: LDC - Load Distributed Checkpoints with PG8.3b2 on Solaris
Previous Message Tom Lane 2007-11-15 15:03:44 Re: LDC - Load Distributed Checkpoints with PG8.3b2 on Solaris