Re: changing text search treatment of puncutation

From: Oleg Bartunov <oleg(at)sai(dot)msu(dot)su>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: John DeSoi <desoi(at)pgedit(dot)com>, Postgresql General List <pgsql-general(at)postgresql(dot)org>
Subject: Re: changing text search treatment of puncutation
Date: 2008-07-03 08:47:17
Message-ID: Pine.LNX.4.64.0807031241320.11363@sn.sai.msu.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, 2 Jul 2008, Tom Lane wrote:

> John DeSoi <desoi(at)pgedit(dot)com> writes:
>> Is there an easy way to change '/' to be treated like '-' ? I've
>> looked over the documentation several times and could not find
>> anything. Even just a way to get the two tokens 'home' and 'work'
>> without the joined form would be helpful.
>
> Seems like the simplest solution is just to apply
> regexp_replace(text, '/', '-', 'g')
> before letting the text search stuff have the string. If you're
> using a trigger to update a tsvector column, this would be pretty
> trivial to do within the trigger.
>
> In general there seem to be a lot of ways that people wish they
> could tweak the text search parser, and telling them to write
> their own parser isn't a very helpful response for most folk.
> I don't have an idea about how to improve the situation, but
> it seems like something that should be thought about.

Sure, we thought about this. The most difficult part in user-configurable
parser (we thought about table-driven finite automata) is the foolproof
design. There are should be algorithms for testing validity of finite
automata, but we don't know any effective way.

Regards,
Oleg
_____________________________________________________________
Oleg Bartunov, Research Scientist, Head of AstroNet (www.astronet.ru),
Sternberg Astronomical Institute, Moscow University, Russia
Internet: oleg(at)sai(dot)msu(dot)su, http://www.sai.msu.su/~megera/
phone: +007(495)939-16-83, +007(495)939-23-83

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Gregory Stark 2008-07-03 09:42:36 Re: Memory use in 8.3 plpgsql with heavy use of xpath()
Previous Message Dmitry Melekhov 2008-07-03 08:20:46 please explain vacuum with WAL