Re: tsearch2 punctuation question

Поиск
Список
Период
Сортировка
Искать
От
Greg Sabino Mullane
Тема
Re: tsearch2 punctuation question
Дата
Msg-id
82ba8d8f860d58412e98d8643ac934a8@biglumber.com
Ответ на
Список
Дерево обсуждения
tsearch2 punctuation question John DeSoi <desoi@pgedit.com>
Re: tsearch2 punctuation question "Greg Sabino Mullane" <greg@turnstep.com>
Re: tsearch2 punctuation question Oleg Bartunov <oleg@sai.msu.su>

-----BEGIN PGP SIGNED MESSAGE-----
Hash: RIPEMD160


> Is there a setting that allows me to specify that strings containing  
> the '/' should be parsed into separate words? As is, I can't find  
> 'apple' or 'orange'.

No setting, I think you would have to mess with tsearch2 dictionaries. A 
far easier approach is to have your application simply split the words 
apart, or even write a wrapper function to do it for you within Postgres, e.g.

CREATE OR REPLACE FUNCTION wordsplit(text) RETURNS text LANGUAGE plperl
AS $_$
 my $string = shift;
 $string =~ s/\W/ /g;
 return $string;
$_$;

SELECT to_tsvector(wordsplit('cat,dog apple/orange'));

- --
Greg Sabino Mullane greg@turnstep.com
PGP Key: 0x14964AC8 200704261140
http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8
-----BEGIN PGP SIGNATURE-----

iD8DBQFGMMikvJuQZxSWSsgRAwq4AKDJv4D6UDKZngU2vZt+cPgr6gGsnwCgmJET
arG3n5+2pXxR+wedZ2LjZYU=
=BPs4
-----END PGP SIGNATURE-----


В списке pgsql-general по дате отправления
От: Tom Lane
Дата:
Сообщение: Re: HP/Pgsql/DBD::Pg issue
От: Rich Shepard
Дата:
Сообщение: Upgrade Process
FAQ