adding a custom tsearch parser

From: "ara(dot)t(dot)howard" <ara(dot)t(dot)howard(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: adding a custom tsearch parser
Date: 2009-11-05 18:43:22
Message-ID: 2524b8cc0911051043s48fd93fcjc2f2b228fac09026@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

i've been playing with the new built-in tsearch functionality and it's
really, really cool.

however, the default parser seems a overly complicated and
non-principle-of-least-surprise - at least to me.

for instance

filename.jpg

will not be found by a search for 'filename', since the default parser
considers 'filename.jpg' not only as one token, but as a hostname.

imho, the best default lexizer would simply scan for patterns of
alph-numerics. in ruby

tokens = content.scan( /\w+/ )

this makes for a very non surprising indexer since a search for 'ara'
after indexing 'ara(dot)t(dot)howard(at)gmail(dot)com' would pull up that record.
currently it does not, since the entire token is consumed as an
'email' token.

my questions are

1) can the current parser be configured in any way?

2) if not, can someone provide and direction towards writing my own
and configuring pg to use it?

3) has any thought been given towards a more general purpose default
parser shipping with pg? (few sites would consider 'versions' as
tokens except those run for us geeks)

kind regards.

--
-a
--
be kind whenever possible... it is always possible - h.h. the 14th dalai lama

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Vick Khera 2009-11-05 20:49:29 Re: Bench marking performance or experience using Solid State Disk Drives (SSD) with postgres
Previous Message Sam Mason 2009-11-05 18:28:41 Re: Adding a null